diff --git a/lib/controllers/providers/api/all_requests_provider.dart b/lib/controllers/providers/api/all_requests_provider.dart index a3a4f3cc..2471d330 100644 --- a/lib/controllers/providers/api/all_requests_provider.dart +++ b/lib/controllers/providers/api/all_requests_provider.dart @@ -88,7 +88,7 @@ class AllRequestsProvider extends ChangeNotifier { try { Map body = { "typeTransaction": [1, 2, 3, 4], - "statusTransaction": [1, 2, 3], + "statusTransaction": [1, 2, 3,4], "priority": [0, 1], "displayData": [], "from": from.toIso8601String(), @@ -120,7 +120,7 @@ class AllRequestsProvider extends ChangeNotifier { try { Map body = { "typeTransaction": [1, 2, 3, 4], - "statusTransaction": [1, 2, 3], + "statusTransaction": [1, 2, 3,4], "priority": [1], "displayData": [] }; @@ -149,7 +149,7 @@ class AllRequestsProvider extends ChangeNotifier { try { Map body = { "typeTransaction": [1, 2, 3, 4], - "statusTransaction": [1, 2, 3], + "statusTransaction": [1, 2, 3,4], "priority": [], "displayData": [1] }; diff --git a/lib/controllers/providers/api/user_provider.dart b/lib/controllers/providers/api/user_provider.dart index dc4fbfcc..1167e7c2 100644 --- a/lib/controllers/providers/api/user_provider.dart +++ b/lib/controllers/providers/api/user_provider.dart @@ -128,6 +128,9 @@ class UserProvider extends ChangeNotifier { response = await ApiManager.instance.post(URLs.updateProfileImage, body: body); if (response.statusCode >= 200 && response.statusCode < 300) { profileImage = image; + String imageId = jsonDecode(response.body)["data"]; + _user.profilePhotoName = URLs.getFileUrl(imageId); + ApiManager.instance.user = _user; } _loading = false; notifyListeners(); diff --git a/lib/views/pages/user/profile_page.dart b/lib/views/pages/user/profile_page.dart index fd6f7f7e..a33d83a7 100644 --- a/lib/views/pages/user/profile_page.dart +++ b/lib/views/pages/user/profile_page.dart @@ -111,7 +111,8 @@ class _ProfilePageState extends State { ); if (croppedFile != null) { - snapshot.uploadProfileImage(_user.userID, File(croppedFile.path)); + await snapshot.uploadProfileImage(_user.userID, File(croppedFile.path)); + Provider.of(context,listen: false).setUser(_userProvider.user); } } }),