chain network name display fixed
This commit is contained in:
@@ -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) ...[
|
||||
|
||||
Reference in New Issue
Block a user