Add copy icon to block height display (#1978)
Serhii committed
Jan 27, 2025 at 17:23 UTC
55d8238ae49a48d05890d6a40dd5cbb814e66d4a
1 file changed
+21
-7
lib/src/screens/wallet_keys/wallet_keys_page.dart
+21
-7
@@ -233,13 +233,27 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
233
? 'Fetching...'
234
: (snapshot.data ?? '---');
235
236
- return Text(
237
- textToDisplay,
238
- style: TextStyle(
239
- fontSize: 14,
240
- fontWeight: FontWeight.w500,
241
- color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
242
- ),
236
+ return Row(
237
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
238
+ children: [
239
+ Text(
240
+ textToDisplay,
241
+ style: TextStyle(
242
+ fontSize: 14,
243
+ fontWeight: FontWeight.w500,
244
+ color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
245
+ ),
246
+ ),
247
+ if (snapshot.connectionState == ConnectionState.done && snapshot.data != null)
248
+ GestureDetector(
249
+ onTap: () => _onCopy(S.of(context).block_height, snapshot.data!, context),
250
+ child: Icon(
251
+ Icons.copy,
252
+ size: 16,
253
+ color: Theme.of(context).textTheme.bodyLarge?.color?.withOpacity(0.7),
254
+ ),
255
+ ),
256
+ ],
257
);
258
},
259
),