完成修复登录缓慢问题-主要接口响应时间决定
完成切换设备机器状态的实时接受和UI实时刷新 完成优化tcp重连的体检,手动切换设备或自动断开后重连的区分
This commit is contained in:
@@ -878,7 +878,19 @@ class _RunningStatusPageState extends State<RunningStatusPage> {
|
||||
SliverToBoxAdapter(
|
||||
child: BlocBuilder<DeviceStatusBloc, DeviceStatusState>(
|
||||
builder: (context, state) {
|
||||
debugPrint('🎨 [UI-Build] BlocBuilder 重建!当前状态类型:${state.runtimeType}');
|
||||
|
||||
|
||||
// 检测到设备切换(状态重置)时,清空图表历史数据
|
||||
if (state is DeviceStatusInitial) {
|
||||
debugPrint('🧹 [UI] 检测到 Initial 状态,准备重置图表数据');
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_resetChartData();
|
||||
});
|
||||
}
|
||||
|
||||
if (state is DeviceStatusUpdated) {
|
||||
debugPrint('📈 [UI] 检测到 Updated 状态,准备追加图表数据');
|
||||
_appendChartData(state);
|
||||
}
|
||||
return Container(margin: const EdgeInsets.all(8), child: _isCardView ? _buildCardContentView(state) : _buildChartContentView(state));
|
||||
@@ -889,6 +901,8 @@ class _RunningStatusPageState extends State<RunningStatusPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _resetChartData() {}
|
||||
}
|
||||
|
||||
// ====================== 带动画的圆形仪表盘 Widget ======================
|
||||
|
||||
Reference in New Issue
Block a user