Added Localizations and ran small fixes
This commit is contained in:
@@ -16,7 +16,7 @@ class PayoutDistributionChart extends StatelessWidget {
|
||||
// 1) Aggregate sums
|
||||
final sums = <String, double>{};
|
||||
for (var op in operations) {
|
||||
final name = op.name ?? AppLocalizations.of(context)!.unknown;
|
||||
final name = op.name;
|
||||
sums[name] = (sums[name] ?? 0) + op.amount;
|
||||
}
|
||||
if (sums.isEmpty) {
|
||||
@@ -32,7 +32,7 @@ class PayoutDistributionChart extends StatelessWidget {
|
||||
final palette = [
|
||||
Theme.of(context).colorScheme.primary,
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
Theme.of(context).colorScheme.tertiary ?? Colors.grey,
|
||||
Theme.of(context).colorScheme.tertiary,
|
||||
Theme.of(context).colorScheme.primaryContainer,
|
||||
Theme.of(context).colorScheme.secondaryContainer,
|
||||
];
|
||||
|
||||
@@ -8,6 +8,8 @@ import 'package:pweb/pages/report/table/filters.dart';
|
||||
import 'package:pweb/pages/report/table/widget.dart';
|
||||
import 'package:pweb/providers/operatioins.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class OperationHistoryPage extends StatefulWidget {
|
||||
const OperationHistoryPage({super.key});
|
||||
@@ -48,6 +50,7 @@ class _OperationHistoryPageState extends State<OperationHistoryPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
return Consumer<OperationProvider>(
|
||||
builder: (context, provider, child) {
|
||||
if (provider.isLoading) {
|
||||
@@ -59,10 +62,10 @@ class _OperationHistoryPageState extends State<OperationHistoryPage> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('Error: ${provider.error}'),
|
||||
Text(loc.notificationError(provider.error ?? loc.noErrorInformation)),
|
||||
ElevatedButton(
|
||||
onPressed: () => provider.loadOperations(),
|
||||
child: const Text('Retry'),
|
||||
child: Text(loc.retry),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -108,4 +111,4 @@ class _OperationHistoryPageState extends State<OperationHistoryPage> {
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user