push batch door sensor, design bugs

This commit is contained in:
ashrafzarkanisala
2024-10-02 01:41:15 +03:00
parent 0d49ad5106
commit 9dbf4b0540
16 changed files with 195 additions and 60 deletions

View File

@ -14,10 +14,6 @@ class GatewayBatchControlView extends StatelessWidget
@override
Widget build(BuildContext context) {
final isExtraLarge = isExtraLargeScreenSize(context);
final isLarge = isLargeScreenSize(context);
final isMedium = isMediumScreenSize(context);
return BlocProvider(
create: (context) => GateWayBloc()..add(GatWayById(gatewayIds.first)),
child: BlocBuilder<GateWayBloc, GateWayState>(
@ -25,28 +21,31 @@ class GatewayBatchControlView extends StatelessWidget
if (state is GatewayLoadingState) {
return const Center(child: CircularProgressIndicator());
} else if (state is UpdateGatewayState) {
return GridView(
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 20),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: isLarge || isExtraLarge || isMedium ? 2 : 1,
mainAxisExtent: 140,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
),
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FirmwareUpdateWidget(deviceId: gatewayIds.first, version: 2),
FactoryResetWidget(
callFactoryReset: () {
context.read<GateWayBloc>().add(
GateWayFactoryReset(
deviceId: gatewayIds.first,
factoryReset:
FactoryResetModel(devicesUuid: gatewayIds),
),
);
},
SizedBox(
width: 170,
height: 140,
child: FirmwareUpdateWidget(
deviceId: gatewayIds.first, version: 2)),
const SizedBox(
width: 12,
),
SizedBox(
width: 170,
height: 140,
child: FactoryResetWidget(
callFactoryReset: () {
context.read<GateWayBloc>().add(
GateWayFactoryReset(
deviceId: gatewayIds.first,
factoryReset:
FactoryResetModel(devicesUuid: gatewayIds),
),
);
},
),
),
],
);