diff --git a/lib/pages/drive_detail/components/drive_explorer_item_tile.dart b/lib/pages/drive_detail/components/drive_explorer_item_tile.dart index 3242497593..8bd3d40751 100644 --- a/lib/pages/drive_detail/components/drive_explorer_item_tile.dart +++ b/lib/pages/drive_detail/components/drive_explorer_item_tile.dart @@ -434,7 +434,6 @@ class EntityActionsMenu extends StatelessWidget { @override Widget build(BuildContext context) { return ArDriveDropdown( - width: item is DriveDataItem ? 240 : 160, height: isMobile(context) ? 44 : 60, anchor: alignment, items: _getItems(item, context, withInfo), diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index 2140b92ca7..b1cfef8bc8 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -269,7 +269,6 @@ class _DriveDetailPageState extends State { tooltip: appLocalizationsOf(context).showMenu, child: ArDriveDropdown( - width: 260, anchor: const Aligned( follower: Alignment.topRight, target: Alignment.bottomRight, @@ -775,7 +774,6 @@ class MobileFolderNavigation extends StatelessWidget { state.currentDrive.ownerAddress); return ArDriveDropdown( - width: 240, anchor: const Aligned( follower: Alignment.topRight, target: Alignment.bottomRight, diff --git a/lib/turbo/topup/views/topup_payment_form.dart b/lib/turbo/topup/views/topup_payment_form.dart index b01c70ecce..6454217039 100644 --- a/lib/turbo/topup/views/topup_payment_form.dart +++ b/lib/turbo/topup/views/topup_payment_form.dart @@ -430,13 +430,6 @@ class TurboPaymentFormViewState extends State { nameOnCardTextField(), ], ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - countryTextField(theme), - ], - ), - const SizedBox(height: 16), Padding( padding: const EdgeInsets.only(bottom: 4, right: 16), child: Align( @@ -493,6 +486,13 @@ class TurboPaymentFormViewState extends State { ), ), const SizedBox(height: 16), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + countryTextField(theme), + ], + ), + const SizedBox(height: 16), Row(children: [promoCodeLabel()]), ScreenTypeLayout.builder( mobile: (context) => Row(children: [ @@ -1018,11 +1018,29 @@ class InputDropdownMenu extends StatefulWidget { class _InputDropdownMenuState extends State> { T? _selectedItem; + final GlobalKey _childKey = GlobalKey(); + double? _childWidth; + double get childWidth => _childWidth ?? 200; + + void _refreshChildWidth() { + final currentContext = _childKey.currentContext; + if (currentContext == null) { + return; + } + + final RenderBox renderBox = + _childKey.currentContext!.findRenderObject() as RenderBox; + + setState(() { + _childWidth = renderBox.size.width; + }); + } @override initState() { super.initState(); _selectedItem = widget.selectedItem; + WidgetsBinding.instance.addPostFrameCallback((_) => _refreshChildWidth()); } @override @@ -1032,13 +1050,12 @@ class _InputDropdownMenuState showScrollbars: true, onClick: widget.onClick, maxHeight: 275, - width: 200, anchor: widget.anchor, items: widget.items .map( (e) => ArDriveDropdownItem( content: Container( - width: 200, + width: _childWidth, alignment: Alignment.center, height: 44, color: widget.backgroundColor ?? @@ -1072,6 +1089,7 @@ class _InputDropdownMenuState ) .toList(), child: Column( + key: _childKey, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, diff --git a/pubspec.lock b/pubspec.lock index 1edbf211e3..009901e51d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -79,11 +79,11 @@ packages: dependency: "direct main" description: path: "." - ref: "v1.10.0" - resolved-ref: "72cd21de7cbd52067924cefac579cdb9d7ef39b7" + ref: "v1.11.0" + resolved-ref: "357ce9113b6c90eb00d3ae4528112a8228d9d11f" url: "https://github.com/ar-io/ardrive_ui.git" source: git - version: "1.10.0" + version: "1.11.0" args: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b3e977405e..544499ce59 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: ardrive_ui: git: url: https://github.com/ar-io/ardrive_ui.git - ref: v1.10.0 + ref: v1.11.0 artemis: ^7.0.0-beta.13 arweave: git: