BillProvider class

The provider responsible for delivering the bills/receipts.

Constructors

BillProvider.test({required BillService billService, required TokenProvider tokenProvider, required BillStore billStore})
Test provider. Use only for test.

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

deleteBills({int requestCount = 2, required List<String> billIds}) Future<AnybillResult<void>>
Delete a given list of bills of the currently authenticated user.
getBillAsPDF({int requestCount = 2, required String billId}) Future<AnybillResult<List<int>>>
Generates a PDF file for a given bill
getBills({int requestCount = 2, String? changesSince, int take = 100, int skip = 0}) Future<AnybillResult<List<BillBaseDto>>>
Retrieve a List<BillBaseDto> with the bills of the current authenticated user.
getCachedBillById(String billId) Future<AnybillResult<BillBaseDto?>>
Retrieve a BillBaseDto specified with the billId from the database.
getCachedBills() Future<AnybillResult<List<BillBaseDto>>>
Retrieve a List<BillBaseDto> with the cached bills of the database.
getCachedBillsAsStream() Future<AnybillResult<Stream<List<BillBaseDto>>>>
Retrieve a Stream<List<BillBaseDto>> with the bills of the current authenticated user using the database. Important!!! Cancel the subscription to avoid memory leaks.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateBillNote({int requestCount = 2, required String billId, required String? note}) Future<AnybillResult<BillBaseDto>>
Updates note of the given bill Id
updateBills({int requestCount = 2}) Future<AnybillResult<List<BillBaseDto>>>
Retrieve a List<BillBaseDto> with the bills of the current authenticated user using the database. If there are no bills saved in the local database, all bills are fetched. If there are bills the last modified date of the latest bill is used to update the bills.
updateIsFavourite({int requestCount = 2, required String billId, required bool isFavourite}) Future<AnybillResult<void>>
Updates the favourite status of a given bill

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance BillProvider
Provides an instance of the BillProvider
final