usability fixes

This commit is contained in:
2026-06-01 20:49:53 +02:00
parent 7b5b962fe6
commit 1d8ab2088c
6 changed files with 167 additions and 38 deletions

View File

@@ -58,6 +58,7 @@ abstract class Category with _$Category {
@freezed
abstract class BillProvider with _$BillProvider {
const factory BillProvider({
required String id,
required String clientId,
required String name,
required String description,
@@ -100,7 +101,7 @@ class HomeController extends ChangeNotifier {
return ApiResponse.success(model.accounts);
}
Future<ApiResponse<List<BillProvider>>> getProviders() async {
Future<ApiResponse<List<BillProvider>>> getProviders(String currency) async {
try {
model.filterableProviders = getFakeProviders();
model.transactions = getFakeTransactions();
@@ -108,7 +109,9 @@ class HomeController extends ChangeNotifier {
model.isLoading = true;
if (!_disposed) notifyListeners();
final response = await http.get('/public/providers?sort=priority,asc');
final response = await http.get(
'/public/providers?currency=$currency&sort=priority,asc',
);
List<BillProvider> providers = PageableModel.fromJson(response).content
.map((e) => BillProvider.fromJson(e as Map<String, dynamic>))
.toList();
@@ -258,6 +261,7 @@ class HomeController extends ChangeNotifier {
List<BillProvider> getFakeProviders() {
return [
BillProvider(
id: '1',
clientId: 'econet_airtime',
name: 'Econet Airtime',
description: 'Econet Airtime',