Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 67a2a33

Browse files
authored
feat: shorten did uri in QrCodePage (#329)
1 parent 12ab233 commit 67a2a33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/features/qr/qr_code_page.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class QrCodePage extends HookConsumerWidget {
6161
children: [
6262
Padding(
6363
padding: const EdgeInsets.symmetric(horizontal: Grid.sm),
64-
// TODO(ethan-tbd): remove portable did copy feature
6564
child: ListTile(
6665
trailing: IconButton(
6766
icon: const Icon(Icons.copy),
@@ -81,7 +80,7 @@ class QrCodePage extends HookConsumerWidget {
8180
),
8281
title: Center(
8382
child: AutoSizeText(
84-
did.uri,
83+
_shortenUri(did.uri),
8584
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
8685
fontWeight: FontWeight.bold,
8786
),
@@ -142,4 +141,8 @@ class QrCodePage extends HookConsumerWidget {
142141
dataModuleShape: QrDataModuleShape.square,
143142
),
144143
);
144+
145+
String _shortenUri(String uri) => uri.length <= 25
146+
? uri
147+
: '${uri.substring(0, 25)}...${uri.substring(uri.length - 7)}';
145148
}

0 commit comments

Comments
 (0)