verification before payment and email fixes
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pshared/models/payment/operation.dart';
|
||||
|
||||
import 'package:pweb/models/load_more_state.dart';
|
||||
import 'package:pweb/pages/report/cards/items.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
@@ -10,11 +11,15 @@ import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
class OperationsCardsList extends StatelessWidget {
|
||||
final List<OperationItem> operations;
|
||||
final ValueChanged<OperationItem>? onTap;
|
||||
final LoadMoreState loadMoreState;
|
||||
final VoidCallback? onLoadMore;
|
||||
|
||||
const OperationsCardsList({
|
||||
super.key,
|
||||
required this.operations,
|
||||
this.onTap,
|
||||
this.loadMoreState = LoadMoreState.hidden,
|
||||
this.onLoadMore,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -26,18 +31,42 @@ class OperationsCardsList extends StatelessWidget {
|
||||
onTap: onTap,
|
||||
);
|
||||
|
||||
if (operations.isEmpty) {
|
||||
return Expanded(
|
||||
child: Center(
|
||||
child: Text(
|
||||
loc.reportPaymentsEmpty,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final extraItems = loadMoreState == LoadMoreState.hidden ? 0 : 1;
|
||||
return Expanded(
|
||||
child: operations.isEmpty
|
||||
? Center(
|
||||
child: Text(
|
||||
loc.reportPaymentsEmpty,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
child: ListView.builder(
|
||||
itemCount: items.length + extraItems,
|
||||
itemBuilder: (context, index) {
|
||||
if (index < items.length) {
|
||||
return items[index];
|
||||
}
|
||||
if (loadMoreState == LoadMoreState.loading) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Center(
|
||||
child: TextButton(
|
||||
onPressed: onLoadMore,
|
||||
child: Text(loc.loadMore),
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: items.length,
|
||||
itemBuilder: (context, index) => items[index],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user