From 1b956e83477d2a24fdb43476d3c9b82510e47b26 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:56:56 -0300 Subject: [PATCH] select --- .../dropdown_menu/dropdown_menu_widget.dart | 19 ++++----- .../src/components/select/select_style.dart | 23 ++++++----- .../src/components/select/select_widget.dart | 40 ++++++++----------- packages/remix/lib/src/helpers/overlay.dart | 1 + .../fortaleza/components/select_theme.dart | 2 +- 5 files changed, 39 insertions(+), 46 deletions(-) diff --git a/packages/remix/lib/src/components/dropdown_menu/dropdown_menu_widget.dart b/packages/remix/lib/src/components/dropdown_menu/dropdown_menu_widget.dart index 8436a333c..016913c1e 100644 --- a/packages/remix/lib/src/components/dropdown_menu/dropdown_menu_widget.dart +++ b/packages/remix/lib/src/components/dropdown_menu/dropdown_menu_widget.dart @@ -98,18 +98,13 @@ class DropdownMenuState extends State { ), ); - return AnimatedBoxSpecWidget( - spec: FlexContainer.box, - duration: animatedStyle?.animated.duration ?? Duration.zero, - curve: animatedStyle?.animated.curve ?? Curves.easeInOut, - child: FlexContainer.flex( - direction: Axis.vertical, - children: List.generate(widget.items.length, (index) { - final item = widget.items[index]; - - return item; - }), - ), + return FlexContainer( + direction: Axis.vertical, + children: List.generate(widget.items.length, (index) { + final item = widget.items[index]; + + return item; + }), ); }, ), diff --git a/packages/remix/lib/src/components/select/select_style.dart b/packages/remix/lib/src/components/select/select_style.dart index 75ead1bf8..67c283697 100644 --- a/packages/remix/lib/src/components/select/select_style.dart +++ b/packages/remix/lib/src/components/select/select_style.dart @@ -39,19 +39,19 @@ class SelectStyle extends SpecStyle { ..color.white() ..border.color.black12() ..padding.all(4) - ..wrap.intrinsicWidth() - ..wrap.transform.scale(0.95) - ..wrap.opacity(0) - ..wrap.padding.top(0) + ..box.wrap.intrinsicWidth() + ..box.wrap.transform.scale(0.95) + ..box.wrap.opacity(0) + ..box.wrap.padding.top(0) ..flex.mainAxisSize.min() ..flex.crossAxisAlignment.start(), $.menu.wrap.transform.scale(1.5), $.menu.autoWidth.off(), spec.on.selected( $.menu.container.chain - ..wrap.transform.scale(1) - ..wrap.opacity(1) - ..wrap.padding.top(4), + ..box.wrap.transform.scale(1) + ..box.wrap.opacity(1) + ..box.wrap.padding.top(4), ), ]; @@ -75,8 +75,8 @@ class SelectStyle extends SpecStyle { ...menuStyle, ...positionStyle, ]).animate( - duration: const Duration(milliseconds: 1500), - curve: Curves.easeInOut, + duration: const Duration(milliseconds: 100), + curve: Curves.decelerate, ); } } @@ -107,6 +107,9 @@ class SelectDarkStyle extends SelectStyle { itemStyle, spec.on.hover($.item.container.color.white12()), spec.on.disabled($.button.container.color.white10()), - ]); + ]).animate( + duration: const Duration(milliseconds: 100), + curve: Curves.decelerate, + ); } } diff --git a/packages/remix/lib/src/components/select/select_widget.dart b/packages/remix/lib/src/components/select/select_widget.dart index 37a72e576..16ce7fd74 100644 --- a/packages/remix/lib/src/components/select/select_widget.dart +++ b/packages/remix/lib/src/components/select/select_widget.dart @@ -47,8 +47,7 @@ class Select extends StatefulWidget { State