improving ui elements
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logger/logger.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:qpay/http/http.dart';
|
||||
import 'package:qpay/models/pageable_model.dart';
|
||||
|
||||
part 'home_controller.freezed.dart';
|
||||
part 'home_controller.g.dart';
|
||||
@@ -116,11 +115,14 @@ class HomeController extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
|
||||
try {
|
||||
List<dynamic> response = await http.get(
|
||||
'/transaction?userId=$userId&type=REQUEST',
|
||||
Map<String, dynamic> response = await http.get(
|
||||
'/transaction?sort=createdAt,desc&size=3&page=0&userId=$userId&type=REQUEST',
|
||||
);
|
||||
|
||||
PageableModel pageableModel = PageableModel.fromJson(response);
|
||||
|
||||
model.transactions =
|
||||
response.map((e) => e as Map<String, dynamic>).toList();
|
||||
pageableModel.content.map((e) => e as Map<String, dynamic>).toList();
|
||||
} catch (e) {
|
||||
logger.e(e);
|
||||
_showErrorSnackBar(
|
||||
|
||||
Reference in New Issue
Block a user