56 lines
1.7 KiB
Dart
56 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:sxchnge_kyc/sxchnge_kyc.dart';
|
|
|
|
import '../generated/i18n/app_localizations.dart';
|
|
|
|
/// Display exact provider decimals; never infer currency scale or active caps.
|
|
class PolicyRow extends StatelessWidget {
|
|
const PolicyRow({super.key, required this.row});
|
|
final PolicyLimit row;
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l = AppLocalizations.of(context)!;
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const Divider(height: 32),
|
|
Text(
|
|
'${row.operation} · ${switch (row.period) {
|
|
'day' => l.kycDay,
|
|
'month' => l.kycMonth,
|
|
'operationMin' => l.kycOperationMinimum,
|
|
'operationMax' => l.kycOperationMaximum,
|
|
_ => row.period,
|
|
}}',
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
),
|
|
const SizedBox(height: 12),
|
|
Wrap(
|
|
spacing: 28,
|
|
runSpacing: 16,
|
|
children: [
|
|
_amount(context, l.kycCurrent, row.cap),
|
|
if (row.remaining.isNotEmpty)
|
|
_amount(context, l.kycRemaining, row.remaining),
|
|
if (row.used.isNotEmpty) _amount(context, l.wUsage, row.used),
|
|
if (row.reserved.isNotEmpty)
|
|
_amount(context, l.kycReserved, row.reserved),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _amount(BuildContext context, String label, String amount) => Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(label),
|
|
Text(
|
|
'$amount ${row.currency}',
|
|
style: Theme.of(context).textTheme.titleLarge,
|
|
),
|
|
],
|
|
);
|
|
}
|