From 0847cb8a41b1ade3d5e921b6fdef50ee4eafb9e0 Mon Sep 17 00:00:00 2001 From: Rafeek-Khoudare Date: Wed, 2 Jul 2025 08:19:56 +0300 Subject: [PATCH] fix UI --- .../create_new_routines/space_dropdown.dart | 205 +++++++++--------- .../main_routine_view/routine_view_card.dart | 16 +- 2 files changed, 113 insertions(+), 108 deletions(-) diff --git a/lib/pages/routines/create_new_routines/space_dropdown.dart b/lib/pages/routines/create_new_routines/space_dropdown.dart index 0d2dc075..0605b7fc 100644 --- a/lib/pages/routines/create_new_routines/space_dropdown.dart +++ b/lib/pages/routines/create_new_routines/space_dropdown.dart @@ -32,113 +32,114 @@ class SpaceDropdown extends StatelessWidget { color: ColorsManager.blackColor, ), ), - SizedBox( - child: Container( + DropdownButton2( + underline: const SizedBox(), + buttonStyleData: ButtonStyleData( + decoration: + BoxDecoration(borderRadius: BorderRadius.circular(12)), + ), + value: selectedValue, + items: spaces.map((space) { + return DropdownMenuItem( + value: space.uuid, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + ' ${space.name}', + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: 16, + fontWeight: FontWeight.bold, + color: selectedValue == space.uuid + ? ColorsManager.dialogBlueTitle + : ColorsManager.blackColor, + ), + ), + Text( + ' ${space.lastThreeParents}', + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: 12, + color: selectedValue == space.uuid + ? ColorsManager.dialogBlueTitle + : ColorsManager.blackColor, + ), + ), + ], + ), + ); + }).toList(), + onChanged: onChanged, + style: TextStyle( + color: Colors.black, + fontSize: 13, + ), + hint: Padding( + padding: const EdgeInsets.only(left: 10), + child: Text( + hintMessage, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + color: ColorsManager.textGray, + ), + ), + ), + customButton: Container( height: 40, + decoration: BoxDecoration( + border: Border.all(color: ColorsManager.textGray, width: 1.0), + borderRadius: BorderRadius.circular(10), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 8, + child: Padding( + padding: const EdgeInsets.only(left: 10), + child: Text( + selectedValue != null + ? spaces + .firstWhere((e) => e.uuid == selectedValue) + .name + : hintMessage, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + fontSize: 13, + color: selectedValue != null + ? Colors.black + : ColorsManager.textGray, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: const BorderRadius.only( + topRight: Radius.circular(10), + bottomRight: Radius.circular(10), + ), + ), + height: 45, + child: const Icon( + Icons.keyboard_arrow_down, + color: ColorsManager.textGray, + ), + ), + ), + ], + ), + ), + dropdownStyleData: DropdownStyleData( + maxHeight: MediaQuery.of(context).size.height * 0.4, decoration: BoxDecoration( color: ColorsManager.whiteColors, borderRadius: BorderRadius.circular(10), ), - child: DropdownButton2( - underline: const SizedBox(), - value: selectedValue, - items: spaces.map((space) { - return DropdownMenuItem( - value: space.uuid, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - ' ${space.name}', - style: - Theme.of(context).textTheme.bodyMedium!.copyWith( - fontSize: 12, - color: ColorsManager.blackColor, - ), - ), - Text( - ' ${space.lastThreeParents}', - style: - Theme.of(context).textTheme.bodyMedium!.copyWith( - fontSize: 12, - ), - ), - ], - ), - ); - }).toList(), - onChanged: onChanged, - style: TextStyle(color: Colors.black), - hint: Padding( - padding: const EdgeInsets.only(left: 10), - child: Text( - hintMessage, - style: Theme.of(context).textTheme.bodySmall!.copyWith( - color: ColorsManager.textGray, - ), - ), - ), - customButton: Container( - height: 45, - decoration: BoxDecoration( - border: - Border.all(color: ColorsManager.textGray, width: 1.0), - borderRadius: BorderRadius.circular(10), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 8, - child: Padding( - padding: const EdgeInsets.only(left: 10), - child: Text( - selectedValue != null - ? spaces - .firstWhere((e) => e.uuid == selectedValue) - .name - : hintMessage, - style: - Theme.of(context).textTheme.bodySmall!.copyWith( - color: selectedValue != null - ? Colors.black - : ColorsManager.textGray, - ), - overflow: TextOverflow.ellipsis, - ), - ), - ), - Expanded( - child: Container( - decoration: BoxDecoration( - color: Colors.grey[200], - borderRadius: const BorderRadius.only( - topRight: Radius.circular(10), - bottomRight: Radius.circular(10), - ), - ), - height: 45, - child: const Icon( - Icons.keyboard_arrow_down, - color: ColorsManager.textGray, - ), - ), - ), - ], - ), - ), - dropdownStyleData: DropdownStyleData( - maxHeight: MediaQuery.of(context).size.height * 0.4, - decoration: BoxDecoration( - color: ColorsManager.whiteColors, - borderRadius: BorderRadius.circular(10), - ), - ), - menuItemStyleData: const MenuItemStyleData( - height: 60, - ), - ), + ), + menuItemStyleData: const MenuItemStyleData( + height: 60, ), ), ], diff --git a/lib/pages/routines/widgets/main_routine_view/routine_view_card.dart b/lib/pages/routines/widgets/main_routine_view/routine_view_card.dart index 4fc4bd0f..df21c93e 100644 --- a/lib/pages/routines/widgets/main_routine_view/routine_view_card.dart +++ b/lib/pages/routines/widgets/main_routine_view/routine_view_card.dart @@ -121,7 +121,8 @@ class _RoutineViewCardState extends State { child: SizedBox( width: 16, height: 16, - child: CircularProgressIndicator(strokeWidth: 2), + child: + CircularProgressIndicator(strokeWidth: 2), ), ), ) @@ -159,8 +160,9 @@ class _RoutineViewCardState extends State { height: iconSize, width: iconSize, fit: BoxFit.contain, - errorBuilder: (context, error, stackTrace) => - Image.asset( + errorBuilder: + (context, error, stackTrace) => + Image.asset( Assets.logo, height: iconSize, width: iconSize, @@ -203,7 +205,8 @@ class _RoutineViewCardState extends State { maxLines: 1, style: context.textTheme.bodySmall?.copyWith( color: ColorsManager.blackColor, - fontSize: widget.isSmallScreenSize(context) ? 10 : 12, + fontSize: + widget.isSmallScreenSize(context) ? 10 : 12, ), ), if (widget.spaceName != '') @@ -222,8 +225,9 @@ class _RoutineViewCardState extends State { maxLines: 1, style: context.textTheme.bodySmall?.copyWith( color: ColorsManager.blackColor, - fontSize: - widget.isSmallScreenSize(context) ? 10 : 12, + fontSize: widget.isSmallScreenSize(context) + ? 10 + : 12, ), ), ],