profile image change improvement

main_design2.0
Sikander Saleem 2 years ago
parent 7e15a266b1
commit e98bd62be9

@ -88,7 +88,7 @@ class AllRequestsProvider extends ChangeNotifier {
try { try {
Map<String, dynamic> body = { Map<String, dynamic> body = {
"typeTransaction": [1, 2, 3, 4], "typeTransaction": [1, 2, 3, 4],
"statusTransaction": [1, 2, 3], "statusTransaction": [1, 2, 3,4],
"priority": [0, 1], "priority": [0, 1],
"displayData": [], "displayData": [],
"from": from.toIso8601String(), "from": from.toIso8601String(),
@ -120,7 +120,7 @@ class AllRequestsProvider extends ChangeNotifier {
try { try {
Map<String, dynamic> body = { Map<String, dynamic> body = {
"typeTransaction": [1, 2, 3, 4], "typeTransaction": [1, 2, 3, 4],
"statusTransaction": [1, 2, 3], "statusTransaction": [1, 2, 3,4],
"priority": [1], "priority": [1],
"displayData": [] "displayData": []
}; };
@ -149,7 +149,7 @@ class AllRequestsProvider extends ChangeNotifier {
try { try {
Map<String, dynamic> body = { Map<String, dynamic> body = {
"typeTransaction": [1, 2, 3, 4], "typeTransaction": [1, 2, 3, 4],
"statusTransaction": [1, 2, 3], "statusTransaction": [1, 2, 3,4],
"priority": [], "priority": [],
"displayData": [1] "displayData": [1]
}; };

@ -128,6 +128,9 @@ class UserProvider extends ChangeNotifier {
response = await ApiManager.instance.post(URLs.updateProfileImage, body: body); response = await ApiManager.instance.post(URLs.updateProfileImage, body: body);
if (response.statusCode >= 200 && response.statusCode < 300) { if (response.statusCode >= 200 && response.statusCode < 300) {
profileImage = image; profileImage = image;
String imageId = jsonDecode(response.body)["data"];
_user.profilePhotoName = URLs.getFileUrl(imageId);
ApiManager.instance.user = _user;
} }
_loading = false; _loading = false;
notifyListeners(); notifyListeners();

@ -111,7 +111,8 @@ class _ProfilePageState extends State<ProfilePage> {
); );
if (croppedFile != null) { if (croppedFile != null) {
snapshot.uploadProfileImage(_user.userID, File(croppedFile.path)); await snapshot.uploadProfileImage(_user.userID, File(croppedFile.path));
Provider.of<SettingProvider>(context,listen: false).setUser(_userProvider.user);
} }
} }
}), }),

Loading…
Cancel
Save