fix(ui): fix error text in warning card and update information for device's inter-family owner
This commit is contained in:
@@ -33,10 +33,17 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
super.initState();
|
||||
homeBloc = BlocProvider.of(context);
|
||||
const duration = Duration(seconds: 10);
|
||||
getAllDevicesTimer =
|
||||
Timer.periodic(duration, (Timer t) => homeBloc.getOwnerAndJoinedDevices(context));
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// Code ở đây chạy sau khi giao diện render xong
|
||||
getAllDevicesTimer =
|
||||
Timer.periodic(duration, (Timer t) => homeBloc.getOwnerAndJoinedDevices(context));
|
||||
// Ví dụ: gọi API, scroll tới vị trí nào đó, v.v.
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
getAllDevicesTimer?.cancel();
|
||||
@@ -53,7 +60,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
homeBloc.getOwnerAndJoinedDevices(context);
|
||||
return const SharedLoadingAnimation();
|
||||
}else{
|
||||
log("Goi else");
|
||||
homeBloc.getOwnerDeviceState(context, aliasDevicesSnapshot.data ?? []);
|
||||
homeBloc.getDeviceStatusAliasMap(aliasDevicesSnapshot.data ?? []);
|
||||
checkSettingDevice(aliasDevicesSnapshot.data ?? []);
|
||||
@@ -210,7 +216,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
StreamBuilder<Map<String, List<DeviceWithAlias>>>(
|
||||
StreamBuilder<Map<String, List<DeviceWithAlias>>?>(
|
||||
stream: homeBloc.streamAllDevicesAliasMap,
|
||||
builder: (context, allDevicesAliasMapSnapshot) {
|
||||
if(allDevicesAliasMapSnapshot.data == null){
|
||||
|
||||
Reference in New Issue
Block a user