diff --git a/lib/feature/home/home_screen.dart b/lib/feature/home/home_screen.dart index 554820b..5d268bf 100644 --- a/lib/feature/home/home_screen.dart +++ b/lib/feature/home/home_screen.dart @@ -82,60 +82,57 @@ class _HomeScreenState extends State { stream: homeBloc.streamOwnerDevicesStatus, builder: (context, snapshot) { if (snapshot.data?['state'] != null || snapshot.data?['battery'] != null) { - return Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (snapshot.data?['state'] != null) - ...snapshot.data!['state']! - .map( - (item) => FutureBuilder( + return ConstrainedBox( + constraints: BoxConstraints(minWidth: MediaQuery.of(context).size.width), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (snapshot.data?['state'] != null) + ...snapshot.data!['state']! + .map( + (item) => SizedBox( + width: context.dynamicWidth(0.95), + child: FutureBuilder( future: warningCard(context, apiServices, item), builder: (context, warningCardSnapshot) { if (warningCardSnapshot.hasData) { - return ConstrainedBox( - constraints: const BoxConstraints( - maxWidth: 400, - maxHeight: 260, - ), - child: warningCardSnapshot.data!, - ); + return warningCardSnapshot.data!; } else { return const SizedBox.shrink(); } }, ), - ) - .toList(), - if (snapshot.data?['battery'] != null) - ...snapshot.data!['battery']! - .map( - (batteryItem) => FutureBuilder( + ), + ) + .toList(), + if (snapshot.data?['battery'] != null) + ...snapshot.data!['battery']! + .map( + (batteryItem) => SizedBox( + width: context.dynamicWidth(0.95), + child: FutureBuilder( future: notificationCard( context, "lowBattery", appLocalization(context).low_battery_message, batteryItem), builder: (context, warningCardSnapshot) { if (warningCardSnapshot.hasData) { - return ConstrainedBox( - constraints: const BoxConstraints( - maxWidth: 400, - maxHeight: 260, - ), - child: warningCardSnapshot.data!, - ); + return warningCardSnapshot.data!; } else { return const SizedBox.shrink(); } }, ), - ) - .toList(), - ], + ), + ) + .toList(), + ], + ), ); } else { return Padding( padding: context.paddingMedium, child: Center( child: Row( + mainAxisSize: MainAxisSize.min, children: [ const Icon( Icons.check_circle_outline_rounded, @@ -159,6 +156,11 @@ class _HomeScreenState extends State { ), ), ), + + + + + StreamBuilder>>( stream: homeBloc.streamAllDevicesAliasMap, builder: (context, allDevicesAliasMapSnapshot) { diff --git a/lib/feature/home/shared/overview_card.dart b/lib/feature/home/shared/overview_card.dart index 8d00c70..c48e83c 100644 --- a/lib/feature/home/shared/overview_card.dart +++ b/lib/feature/home/shared/overview_card.dart @@ -23,7 +23,6 @@ class OverviewCard extends StatelessWidget { @override Widget build(BuildContext context) { return Card( - margin: context.paddingLow, elevation: 8, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), child: Padding(