37 lines
908 B
Dart
37 lines
908 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:pshared/models/payment/payment.dart';
|
|
|
|
import 'package:pweb/pages/report/details/sections/fx.dart';
|
|
import 'package:pweb/pages/report/details/sections/metadata.dart';
|
|
|
|
|
|
class PaymentDetailsSections extends StatelessWidget {
|
|
final Payment payment;
|
|
|
|
const PaymentDetailsSections({
|
|
super.key,
|
|
required this.payment,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final hasFx = _hasFxQuote(payment);
|
|
if (!hasFx) {
|
|
return PaymentMetadataSection(payment: payment);
|
|
}
|
|
|
|
return Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Expanded(child: PaymentFxSection(payment: payment)),
|
|
const SizedBox(width: 16),
|
|
Expanded(child: PaymentMetadataSection(payment: payment)),
|
|
],
|
|
);
|
|
}
|
|
|
|
bool _hasFxQuote(Payment payment) => payment.lastQuote?.fxQuote != null;
|
|
|
|
}
|