对接远程遥控
This commit is contained in:
@@ -11,6 +11,7 @@ import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/work_orde
|
||||
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/quick_entry_card.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/power_trend_chart.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/plant_overview_card.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/tcp_status_indicator.dart';
|
||||
|
||||
class HomeV2Page extends StatefulWidget {
|
||||
const HomeV2Page({super.key});
|
||||
@@ -100,10 +101,7 @@ class _HomeV2PageState extends State<HomeV2Page> {
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.qr_code_scanner, size: 24, color: Color(0xFF1D2129)),
|
||||
onPressed: () => print('点击扫码'),
|
||||
),
|
||||
const TcpStatusIndicator(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -206,7 +204,12 @@ class _HomeV2PageState extends State<HomeV2Page> {
|
||||
super.didChangeDependencies();
|
||||
// 首次进入时自动加载数据,但不显示转圈
|
||||
if (_bloc.state is HomeV2Initial) {
|
||||
_bloc.add(const HomeV2LoadData());
|
||||
// 延迟 100ms,确保 AppUserCubit 状态已更新
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
if (mounted) {
|
||||
_bloc.add(const HomeV2LoadData());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user