push devices managment screen

This commit is contained in:
ashrafzarkanisala
2024-11-25 10:15:31 +03:00
parent 19694bec98
commit 8b76429714

View File

@ -88,32 +88,31 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
);
}),
rightBody: const NavigateHomeGridView(),
scaffoldBody: CreateNewRoutineView(),
// BlocBuilder<SwitchTabsBloc, SwitchTabsState>(
// builder: (context, state) {
// if (state is SelectedTabState && state.selectedTab) {
// return const RoutinesView();
// }
// if (state is ShowCreateRoutineState && state.showCreateRoutine) {
// return const CreateNewRoutineView();
// }
scaffoldBody: BlocBuilder<SwitchTabsBloc, SwitchTabsState>(
builder: (context, state) {
if (state is SelectedTabState && state.selectedTab) {
return const RoutinesView();
}
if (state is ShowCreateRoutineState && state.showCreateRoutine) {
return const CreateNewRoutineView();
}
// return BlocBuilder<DeviceManagementBloc, DeviceManagementState>(
// builder: (context, deviceState) {
// if (deviceState is DeviceManagementLoading) {
// return const Center(child: CircularProgressIndicator());
// } else if (deviceState is DeviceManagementLoaded ||
// deviceState is DeviceManagementFiltered) {
// final devices = (deviceState as dynamic).devices ??
// (deviceState as DeviceManagementFiltered).filteredDevices;
return BlocBuilder<DeviceManagementBloc, DeviceManagementState>(
builder: (context, deviceState) {
if (deviceState is DeviceManagementLoading) {
return const Center(child: CircularProgressIndicator());
} else if (deviceState is DeviceManagementLoaded ||
deviceState is DeviceManagementFiltered) {
final devices = (deviceState as dynamic).devices ??
(deviceState as DeviceManagementFiltered).filteredDevices;
// return DeviceManagementBody(devices: devices);
// } else {
// return const Center(child: Text('Error fetching Devices'));
// }
// },
// );
// }),
return DeviceManagementBody(devices: devices);
} else {
return const Center(child: Text('Error fetching Devices'));
}
},
);
}),
),
);
}