WIP: integration with ledger
This commit is contained in:
72
frontend/pweb/lib/pages/wallet_top_up/ledger_content.dart
Normal file
72
frontend/pweb/lib/pages/wallet_top_up/ledger_content.dart
Normal file
@@ -0,0 +1,72 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pshared/models/ledger/account.dart';
|
||||
|
||||
import 'package:pweb/pages/wallet_top_up/details.dart';
|
||||
import 'package:pweb/pages/wallet_top_up/header.dart';
|
||||
import 'package:pweb/pages/wallet_top_up/meta.dart';
|
||||
import 'package:pweb/utils/dimensions.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class LedgerTopUpContent extends StatelessWidget {
|
||||
final LedgerAccount account;
|
||||
final VoidCallback onBack;
|
||||
|
||||
const LedgerTopUpContent({
|
||||
super.key,
|
||||
required this.account,
|
||||
required this.onBack,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final dimensions = AppDimensions();
|
||||
final theme = Theme.of(context);
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
|
||||
return Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: SingleChildScrollView(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 960),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: dimensions.paddingLarge),
|
||||
child: Material(
|
||||
elevation: dimensions.elevationSmall,
|
||||
color: theme.colorScheme.onSecondary,
|
||||
borderRadius: BorderRadius.circular(
|
||||
dimensions.borderRadiusMedium,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(dimensions.paddingXLarge),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
WalletTopUpHeader(
|
||||
onBack: onBack,
|
||||
tokenSymbol: account.currency,
|
||||
sourceLabel: loc.paymentTypeLedger,
|
||||
),
|
||||
SizedBox(height: dimensions.paddingLarge),
|
||||
WalletTopUpMeta(
|
||||
assetLabel: account.currency,
|
||||
walletId: account.accountCode,
|
||||
idLabel: loc.ledgerAccountRef,
|
||||
),
|
||||
SizedBox(height: dimensions.paddingXLarge),
|
||||
WalletTopUpDetails(
|
||||
address: account.ledgerAccountRef,
|
||||
dimensions: dimensions,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user