42 lines
1.4 KiB
Dart
42 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:sxchnge_wallet/sxchnge_wallet.dart';
|
|
|
|
import '../generated/i18n/app_localizations.dart';
|
|
|
|
/// Structured review renders the immutable service snapshot, never a nickname.
|
|
class DestinationDetailsView extends StatelessWidget {
|
|
const DestinationDetailsView({super.key, required this.details});
|
|
final DestinationDetails details;
|
|
Widget field(String label, String value) => Padding(
|
|
padding: const EdgeInsets.only(top: 12),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [Text(label), SelectableText(value)],
|
|
),
|
|
);
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l = AppLocalizations.of(context)!;
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: switch (details) {
|
|
CryptoDestination d => [
|
|
field(l.dAsset, d.assetLabel),
|
|
field(l.dNetwork, d.networkLabel),
|
|
field(l.dAddress, d.address),
|
|
field(l.dMemo, d.memo.isEmpty ? l.dNoMemo : d.memo),
|
|
],
|
|
CardDestination d => [field(l.dCard, d.display)],
|
|
RussianBankDestination d => [
|
|
field(l.dHolder, d.holder),
|
|
field(l.dBankSearch, d.bank.name),
|
|
field(l.dBik, d.bank.bik),
|
|
field(l.dAccount, d.account),
|
|
field(l.dCorrespondent, d.bank.correspondent),
|
|
],
|
|
},
|
|
);
|
|
}
|
|
}
|