multiple payout page and small fixes
This commit is contained in:
@@ -12,14 +12,13 @@ class MultiPaymentProvider extends ChangeNotifier {
|
||||
late OrganizationsProvider _organization;
|
||||
late MultiQuotationProvider _quotation;
|
||||
|
||||
Resource<List<Payment>> _payments = Resource(data: []);
|
||||
bool _isLoaded = false;
|
||||
Resource<List<Payment>> _payments = Resource(data: null);
|
||||
|
||||
List<Payment> get payments => _payments.data ?? [];
|
||||
bool get isLoading => _payments.isLoading;
|
||||
Exception? get error => _payments.error;
|
||||
bool get isReady =>
|
||||
_isLoaded && !_payments.isLoading && _payments.error == null;
|
||||
_payments.data != null && !_payments.isLoading && _payments.error == null;
|
||||
|
||||
void update(
|
||||
OrganizationsProvider organization,
|
||||
@@ -56,7 +55,6 @@ class MultiPaymentProvider extends ChangeNotifier {
|
||||
metadata: metadata,
|
||||
);
|
||||
|
||||
_isLoaded = true;
|
||||
_setResource(
|
||||
_payments.copyWith(data: response, isLoading: false, error: null),
|
||||
);
|
||||
@@ -70,8 +68,7 @@ class MultiPaymentProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
void reset() {
|
||||
_isLoaded = false;
|
||||
_setResource(Resource(data: []));
|
||||
_setResource(Resource(data: null));
|
||||
}
|
||||
|
||||
void _setResource(Resource<List<Payment>> payments) {
|
||||
|
||||
Reference in New Issue
Block a user