Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-7294: Release ArDrive v2.60.1 #1942

Merged
merged 9 commits into from
Dec 12, 2024
2 changes: 2 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/169.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixed profile card alignment
- Fixed an issue where sync gets stuck after failing to fetch a metadata t
2 changes: 1 addition & 1 deletion lib/components/app_top_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
66 changes: 40 additions & 26 deletions lib/components/profile_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -714,18 +714,30 @@ 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) {
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,
);
}

Expand All @@ -741,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();
Expand All @@ -763,38 +775,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,
),
),
),
],
Expand Down
5 changes: 4 additions & 1 deletion lib/services/arweave/arweave_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,10 @@ class ArweaveService {
return cachedData;
}

return getEntityDataFromNetwork(txId: txId);
return getEntityDataFromNetwork(txId: txId).catchError((e) {
logger.e('Failed to get entity data from network', e);
return Uint8List(0);
});
}

Future<Uint8List?> _getCachedEntityDataFromSnapshot({
Expand Down
8 changes: 5 additions & 3 deletions packages/ardrive_ui/lib/src/components/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,11 @@ class _ArDriveButtonNewState extends State<ArDriveButtonNew> {
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,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading