From 50aca65c8f2934401634bbc697c99a995e73ed17 Mon Sep 17 00:00:00 2001 From: Abdullah Alassaf Date: Sun, 30 Jun 2024 15:37:00 +0300 Subject: [PATCH] Fixed design issues --- .../scene_devices/scene_devices_body.dart | 4 ++-- lib/utils/context_extension.dart | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/features/scene/widgets/scene_devices/scene_devices_body.dart b/lib/features/scene/widgets/scene_devices/scene_devices_body.dart index fc82b2a..0eaa7e2 100644 --- a/lib/features/scene/widgets/scene_devices/scene_devices_body.dart +++ b/lib/features/scene/widgets/scene_devices/scene_devices_body.dart @@ -41,8 +41,7 @@ class SceneDevicesBody extends StatelessWidget { text: e.name ?? '', textAlign: TextAlign.start, style: context.bodyLarge.copyWith( - color: (tabState is TabSelected) && - tabState.roomId == e.id + color: (tabState is TabSelected) && tabState.roomId == e.id ? ColorsManager.textPrimaryColor : ColorsManager.textPrimaryColor.withOpacity(0.2), ), @@ -55,6 +54,7 @@ class SceneDevicesBody extends StatelessWidget { Expanded( child: TabBarView( controller: _tabController, + physics: const NeverScrollableScrollPhysics(), children: rooms!.map((e) => _buildRoomTab(e, context)).toList(), ), ), diff --git a/lib/utils/context_extension.dart b/lib/utils/context_extension.dart index 6a84c60..d296d0a 100644 --- a/lib/utils/context_extension.dart +++ b/lib/utils/context_extension.dart @@ -14,8 +14,7 @@ extension ContextExtension on BuildContext { double get height => MediaQuery.sizeOf(this).height; - InputDecorationTheme get inputDecoration => - Theme.of(this).inputDecorationTheme; + InputDecorationTheme get inputDecoration => Theme.of(this).inputDecorationTheme; TextStyle get displayLarge => Theme.of(this).textTheme.displayLarge!; @@ -61,9 +60,7 @@ extension ContextExtension on BuildContext { } void customAlertDialog( - {required Widget alertBody, - required String title, - required VoidCallback onConfirm}) { + {required Widget alertBody, required String title, required VoidCallback onConfirm}) { showDialog( context: this, builder: (BuildContext context) { @@ -100,7 +97,7 @@ extension ContextExtension on BuildContext { ), /// custom body content - alertBody, + Flexible(child: SingleChildScrollView(child: alertBody)), /// Footer buttons Container( @@ -118,8 +115,7 @@ extension ContextExtension on BuildContext { child: Center( child: BodyMedium( text: 'Cancel', - style: context.bodyMedium - .copyWith(color: ColorsManager.greyColor), + style: context.bodyMedium.copyWith(color: ColorsManager.greyColor), ), ), ), @@ -133,8 +129,8 @@ extension ContextExtension on BuildContext { child: Center( child: BodyMedium( text: 'Confirm', - style: context.bodyMedium.copyWith( - color: ColorsManager.primaryColorWithOpacity), + style: context.bodyMedium + .copyWith(color: ColorsManager.primaryColorWithOpacity), ), ), ),