90 lines
2.7 KiB
Dart
90 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:pshared/controllers/balance_mask/wallets.dart';
|
|
import 'package:pshared/utils/currency.dart';
|
|
|
|
import 'package:pweb/models/summary_values.dart';
|
|
import 'package:pweb/pages/dashboard/payouts/summary/fee.dart';
|
|
import 'package:pweb/pages/dashboard/payouts/summary/recipient_receives.dart';
|
|
import 'package:pweb/pages/dashboard/payouts/summary/row.dart';
|
|
import 'package:pweb/pages/dashboard/payouts/summary/sent_amount.dart';
|
|
import 'package:pweb/pages/dashboard/payouts/summary/total.dart';
|
|
|
|
import 'package:pweb/generated/i18n/app_localizations.dart';
|
|
|
|
|
|
class PaymentSummary extends StatelessWidget {
|
|
final double spacing;
|
|
final PaymentSummaryValues? values;
|
|
|
|
const PaymentSummary({
|
|
super.key,
|
|
required this.spacing,
|
|
this.values,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final resolvedValues = values;
|
|
if (resolvedValues != null) {
|
|
final theme = Theme.of(context);
|
|
final loc = AppLocalizations.of(context)!;
|
|
return Align(
|
|
alignment: Alignment.center,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
PaymentSummaryRow(
|
|
labelFactory: loc.sentAmount,
|
|
asset: null,
|
|
value: resolvedValues.sentAmount,
|
|
style: theme.textTheme.titleMedium,
|
|
),
|
|
PaymentSummaryRow(
|
|
labelFactory: loc.fee,
|
|
asset: null,
|
|
value: resolvedValues.fee,
|
|
style: theme.textTheme.titleMedium,
|
|
),
|
|
PaymentSummaryRow(
|
|
labelFactory: loc.recipientWillReceive,
|
|
asset: null,
|
|
value: resolvedValues.recipientReceives,
|
|
style: theme.textTheme.titleMedium,
|
|
),
|
|
SizedBox(height: spacing),
|
|
PaymentSummaryRow(
|
|
labelFactory: loc.total,
|
|
asset: null,
|
|
value: resolvedValues.total,
|
|
style: theme.textTheme.titleMedium?.copyWith(
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
return Align(
|
|
alignment: Alignment.center,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
PaymentSentAmountRow(
|
|
currency: currencyStringToCode(
|
|
context.read<WalletsController>().selectedWallet?.tokenSymbol ??
|
|
'USDT',
|
|
),
|
|
),
|
|
const PaymentFeeRow(),
|
|
const PaymentRecipientReceivesRow(),
|
|
SizedBox(height: spacing),
|
|
const PaymentTotalRow(),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |