From 9f3ba28c0dcb8d8b1d136a609847aa88ee2ce3ad Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:22:14 -0300 Subject: [PATCH 1/6] fix alignment --- lib/components/app_top_bar.dart | 2 +- lib/components/profile_card.dart | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/components/app_top_bar.dart b/lib/components/app_top_bar.dart index 5743a637d..3645ac08a 100644 --- a/lib/components/app_top_bar.dart +++ b/lib/components/app_top_bar.dart @@ -27,7 +27,7 @@ class AppTopBar extends StatelessWidget { height: 110, width: double.maxFinite, child: Padding( - padding: const EdgeInsets.only(right: 24.0), + padding: const EdgeInsets.only(right: 17.0), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, diff --git a/lib/components/profile_card.dart b/lib/components/profile_card.dart index 54de4f719..12962c64f 100644 --- a/lib/components/profile_card.dart +++ b/lib/components/profile_card.dart @@ -722,10 +722,21 @@ class ProfileCardHeader extends StatelessWidget { if (primaryName.length > 20) { return truncateString(walletAddress, offsetStart: 10, offsetEnd: 10); } + var offsetStart = primaryName.length ~/ 2; + var offsetEnd = primaryName.length ~/ 2; + + if (offsetStart < 6) { + offsetStart = 3; + } + + if (offsetEnd < 6) { + offsetEnd = 3; + } + return truncateString( walletAddress, - offsetStart: primaryName.length ~/ 2, - offsetEnd: primaryName.length ~/ 2, + offsetStart: offsetStart, + offsetEnd: offsetEnd, ); } From 142d9036809adc4981cb8b5267a2a44b7488ffc3 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:21:53 -0300 Subject: [PATCH 2/6] fix alignment and button size --- lib/components/profile_card.dart | 42 ++++++++++--------- .../ardrive_ui/lib/src/components/button.dart | 8 ++-- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/lib/components/profile_card.dart b/lib/components/profile_card.dart index 12962c64f..70475a53f 100644 --- a/lib/components/profile_card.dart +++ b/lib/components/profile_card.dart @@ -774,38 +774,40 @@ class ProfileCardHeader extends StatelessWidget { final colorTokens = ArDriveTheme.of(context).themeData.colorTokens; final icon = _buildProfileIcon(state); - return SizedBox( - height: 46, - width: maxWidth, + return ConstrainedBox( + constraints: BoxConstraints(maxWidth: maxWidth), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, children: [ if (icon != null) icon, - Expanded( + Flexible( child: SizedBox( height: 46, - width: maxWidth, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - primaryName, - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: typography.paragraphLarge( - fontWeight: ArFontWeight.semiBold, - color: colorTokens.textHigh, + Flexible( + child: Text( + primaryName, + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, + color: colorTokens.textHigh, + ), ), ), - Text( - truncatedWalletAddress, - overflow: TextOverflow.clip, - maxLines: 1, - style: typography.paragraphSmall( - fontWeight: ArFontWeight.book, - color: colorTokens.textLow, + Flexible( + child: Text( + truncatedWalletAddress, + overflow: TextOverflow.clip, + maxLines: 1, + style: typography.paragraphSmall( + fontWeight: ArFontWeight.book, + color: colorTokens.textLow, + ), ), ), ], diff --git a/packages/ardrive_ui/lib/src/components/button.dart b/packages/ardrive_ui/lib/src/components/button.dart index 5ffcf9e33..c909e4b84 100644 --- a/packages/ardrive_ui/lib/src/components/button.dart +++ b/packages/ardrive_ui/lib/src/components/button.dart @@ -381,9 +381,11 @@ class _ArDriveButtonNewState extends State { final buttonH = widget.maxHeight ?? buttonDefaultHeight; if (widget.content != null) { - return SizedBox( - height: buttonH, - width: widget.maxWidth, + return ConstrainedBox( + constraints: BoxConstraints( + maxWidth: widget.maxWidth ?? double.infinity, + maxHeight: buttonH, + ), child: TextButton( onPressed: widget.onPressed, style: style, From bdc4a9cce51520df44a4c5954883ae4bd23b85d9 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:08:17 -0300 Subject: [PATCH 3/6] Update arweave_service.dart --- lib/services/arweave/arweave_service.dart | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/services/arweave/arweave_service.dart b/lib/services/arweave/arweave_service.dart index 5802f3f9e..c27307447 100644 --- a/lib/services/arweave/arweave_service.dart +++ b/lib/services/arweave/arweave_service.dart @@ -444,19 +444,23 @@ class ArweaveService { required String driveId, required bool isPrivate, }) async { - final txId = entityId; + try { + final txId = entityId; - final cachedData = await _getCachedEntityDataFromSnapshot( - driveId: driveId, - txId: txId, - isPrivate: isPrivate, - ); + final cachedData = await _getCachedEntityDataFromSnapshot( + driveId: driveId, + txId: txId, + isPrivate: isPrivate, + ); - if (cachedData != null) { - return cachedData; - } + if (cachedData != null) { + return cachedData; + } - return getEntityDataFromNetwork(txId: txId); + return getEntityDataFromNetwork(txId: txId); + } catch (e) { + return Uint8List(0); + } } Future _getCachedEntityDataFromSnapshot({ From 1252767050c947c4945e342a48717551352c5883 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:16:17 -0300 Subject: [PATCH 4/6] Update arweave_service.dart --- lib/services/arweave/arweave_service.dart | 25 +++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/services/arweave/arweave_service.dart b/lib/services/arweave/arweave_service.dart index c27307447..0586bd88d 100644 --- a/lib/services/arweave/arweave_service.dart +++ b/lib/services/arweave/arweave_service.dart @@ -444,23 +444,22 @@ class ArweaveService { required String driveId, required bool isPrivate, }) async { - try { - final txId = entityId; + final txId = entityId; - final cachedData = await _getCachedEntityDataFromSnapshot( - driveId: driveId, - txId: txId, - isPrivate: isPrivate, - ); + final cachedData = await _getCachedEntityDataFromSnapshot( + driveId: driveId, + txId: txId, + isPrivate: isPrivate, + ); - if (cachedData != null) { - return cachedData; - } + if (cachedData != null) { + return cachedData; + } - return getEntityDataFromNetwork(txId: txId); - } catch (e) { + return getEntityDataFromNetwork(txId: txId).catchError((e) { + logger.e('Failed to get entity data from network', e); return Uint8List(0); - } + }); } Future _getCachedEntityDataFromSnapshot({ From 924bb251b8bc6d5209e8290066a0c5431d1a94c8 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:17:08 -0300 Subject: [PATCH 5/6] Update profile_card.dart fix icon size and alignment --- lib/components/profile_card.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/components/profile_card.dart b/lib/components/profile_card.dart index 70475a53f..6bcfc12b2 100644 --- a/lib/components/profile_card.dart +++ b/lib/components/profile_card.dart @@ -714,8 +714,9 @@ class ProfileCardHeader extends StatelessWidget { return 100; } - double width = primaryName.length * 15; - return width.clamp(110, 220); + double width = primaryName.length * 20; + + return width.clamp(110, 230); } String _getTruncatedWalletAddress(String primaryName, String walletAddress) { @@ -752,8 +753,8 @@ class ProfileCardHeader extends StatelessWidget { image: NetworkImage( 'https://arweave.net/${state.primaryNameDetails.logo}', ), - width: 28, - height: 28, + width: 34, + height: 34, fit: BoxFit.cover, errorBuilder: (context, error, stackTrace) { return const SizedBox.shrink(); From 704b03dcdbd86df0b1f0ed3c129333469d2ec83b Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:26:12 -0300 Subject: [PATCH 6/6] release notes and bump version --- android/fastlane/metadata/android/en-US/changelogs/169.txt | 2 ++ pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 android/fastlane/metadata/android/en-US/changelogs/169.txt diff --git a/android/fastlane/metadata/android/en-US/changelogs/169.txt b/android/fastlane/metadata/android/en-US/changelogs/169.txt new file mode 100644 index 000000000..878ce1e46 --- /dev/null +++ b/android/fastlane/metadata/android/en-US/changelogs/169.txt @@ -0,0 +1,2 @@ +- Fixed profile card alignment +- Fixed an issue where sync gets stuck after failing to fetch a metadata t diff --git a/pubspec.yaml b/pubspec.yaml index ed5d96d5e..89e947a3e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Secure, permanent storage publish_to: 'none' -version: 2.60.0 +version: 2.60.1 environment: sdk: '>=3.2.0 <4.0.0'