redesigned payment page + a lot of fixes
This commit is contained in:
44
frontend/pweb/lib/pages/report/operations/view.dart
Normal file
44
frontend/pweb/lib/pages/report/operations/view.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pweb/controllers/operations/report_operations.dart';
|
||||
import 'package:pweb/pages/report/operations/actions.dart';
|
||||
import 'package:pweb/pages/report/operations/content.dart';
|
||||
import 'package:pweb/pages/report/operations/states/error.dart';
|
||||
import 'package:pweb/pages/report/operations/states/loading.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class OperationHistoryView extends StatelessWidget {
|
||||
const OperationHistoryView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
return Consumer<ReportOperationsController>(
|
||||
builder: (context, controller, child) {
|
||||
if (controller.isLoading) {
|
||||
return const OperationHistoryLoading();
|
||||
}
|
||||
|
||||
if (controller.error != null) {
|
||||
final message = controller.error?.toString() ?? loc.noErrorInformation;
|
||||
return OperationHistoryError(
|
||||
message: loc.notificationError(message),
|
||||
retryLabel: loc.retry,
|
||||
onRetry: controller.refresh,
|
||||
);
|
||||
}
|
||||
|
||||
return OperationHistoryContent(
|
||||
controller: controller,
|
||||
onPickRange: () => pickOperationsRange(context, controller),
|
||||
onOperationTap: (operation) =>
|
||||
openPaymentDetails(context, operation),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user