chain network name display fixed

This commit is contained in:
Stephan D
2025-12-24 18:17:35 +01:00
parent 5836292adb
commit 9e6d530385
24 changed files with 143 additions and 78 deletions

View File

@@ -1,8 +1,12 @@
import 'package:flutter/material.dart';
import 'package:pshared/models/payment/chain_network.dart';
import 'package:pshared/utils/l10n/chain.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class BalanceHeader extends StatelessWidget {
final String? walletNetwork;
final ChainNetwork? walletNetwork;
final String? tokenSymbol;
const BalanceHeader({
@@ -15,14 +19,33 @@ class BalanceHeader extends StatelessWidget {
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
final colorScheme = Theme.of(context).colorScheme;
final loc = AppLocalizations.of(context)!;
final symbol = tokenSymbol?.trim();
final networkLabel = (walletNetwork == null || walletNetwork == ChainNetwork.unspecified)
? null
: walletNetwork!.localizedName(context);
return Row(
children: [
Text(
'Crypto Wallet',
style: textTheme.titleMedium?.copyWith(
color: colorScheme.onSurface,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
loc.paymentTypeCryptoWallet,
style: textTheme.titleMedium?.copyWith(
color: colorScheme.onSurface,
),
),
if (networkLabel != null)
Text(
networkLabel,
style: textTheme.bodySmall?.copyWith(
color: colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w500,
),
),
],
),
),
if (symbol != null && symbol.isNotEmpty) ...[