From dd5d0e57d0ccb7bbdc392c249bcbc1cad99d8f87 Mon Sep 17 00:00:00 2001 From: Mati Date: Wed, 27 Sep 2023 15:38:07 -0300 Subject: [PATCH 1/5] feat(topup dialog): makes the dropdown overlay match the with of the field PE-4397 --- lib/turbo/topup/views/topup_payment_form.dart | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/turbo/topup/views/topup_payment_form.dart b/lib/turbo/topup/views/topup_payment_form.dart index 49e690b5c6..f86dc07940 100644 --- a/lib/turbo/topup/views/topup_payment_form.dart +++ b/lib/turbo/topup/views/topup_payment_form.dart @@ -1017,11 +1017,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 @@ -1031,13 +1049,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 ?? @@ -1071,6 +1088,7 @@ class _InputDropdownMenuState ) .toList(), child: Column( + key: _childKey, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, From bce579c7f47ed5f05bd46f51f199e0601b6613b8 Mon Sep 17 00:00:00 2001 From: Mati Date: Wed, 27 Sep 2023 15:41:37 -0300 Subject: [PATCH 2/5] chore(cleanup): removes unused arguments PE-4397 --- lib/pages/drive_detail/components/drive_explorer_item_tile.dart | 1 - lib/pages/drive_detail/drive_detail_page.dart | 2 -- 2 files changed, 3 deletions(-) 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 6da5fa614d..3e77689bb2 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -268,7 +268,6 @@ class _DriveDetailPageState extends State { tooltip: appLocalizationsOf(context).showMenu, child: ArDriveDropdown( - width: 260, anchor: const Aligned( follower: Alignment.topRight, target: Alignment.bottomRight, @@ -774,7 +773,6 @@ class MobileFolderNavigation extends StatelessWidget { state.currentDrive.ownerAddress); return ArDriveDropdown( - width: 240, anchor: const Aligned( follower: Alignment.topRight, target: Alignment.bottomRight, From 731ef3bd31256b13e854878e6569c4ac021c839b Mon Sep 17 00:00:00 2001 From: Mati Date: Wed, 27 Sep 2023 15:42:38 -0300 Subject: [PATCH 3/5] feat(deps): update the ArDrive UI dep PE-4397 --- pubspec.lock | 6 +++--- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index c9157fd185..15c1e7020f 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: PE-4397 + resolved-ref: "2d51239f7850b331daaf540464f6f94e902a5b4e" 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 1c09bc37a7..f172dc6485 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: PE-4397 artemis: ^7.0.0-beta.13 arweave: git: From 9cfad0132f2b82250016a60bcef204e83c8177e6 Mon Sep 17 00:00:00 2001 From: Mati Date: Wed, 27 Sep 2023 16:00:33 -0300 Subject: [PATCH 4/5] feat(topup modal): moves the country dropdown just below the credit card field PE-4397 --- lib/turbo/topup/views/topup_payment_form.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/turbo/topup/views/topup_payment_form.dart b/lib/turbo/topup/views/topup_payment_form.dart index f86dc07940..2cd9fb3878 100644 --- a/lib/turbo/topup/views/topup_payment_form.dart +++ b/lib/turbo/topup/views/topup_payment_form.dart @@ -429,13 +429,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( @@ -492,6 +485,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: [ From 80347232ee6079ae28ca297a546feccee92f70c2 Mon Sep 17 00:00:00 2001 From: Mati Date: Thu, 28 Sep 2023 17:16:29 -0300 Subject: [PATCH 5/5] feat(pubspec): bumps version of ardrive-io PE-4397 --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 15c1e7020f..399c8eb5b1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -79,8 +79,8 @@ packages: dependency: "direct main" description: path: "." - ref: PE-4397 - resolved-ref: "2d51239f7850b331daaf540464f6f94e902a5b4e" + ref: "v1.11.0" + resolved-ref: "357ce9113b6c90eb00d3ae4528112a8228d9d11f" url: "https://github.com/ar-io/ardrive_ui.git" source: git version: "1.11.0" diff --git a/pubspec.yaml b/pubspec.yaml index f172dc6485..8d6fba7ebd 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: PE-4397 + ref: v1.11.0 artemis: ^7.0.0-beta.13 arweave: git: