|
|
|
|
|
|
|
|
import 'package:farm_tpf/custom_model/password.dart'; |
|
|
import 'package:farm_tpf/custom_model/password.dart'; |
|
|
|
|
|
import 'package:farm_tpf/data/api/app_exception.dart'; |
|
|
import 'package:farm_tpf/data/repository/user_repository.dart'; |
|
|
import 'package:farm_tpf/data/repository/user_repository.dart'; |
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_loading.dart'; |
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_loading.dart'; |
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_toast.dart'; |
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_toast.dart'; |
|
|
|
|
|
|
|
|
child: WidgetToast(message: "Cập nhật thành công")); |
|
|
child: WidgetToast(message: "Cập nhật thành công")); |
|
|
Navigator.pop(context); |
|
|
Navigator.pop(context); |
|
|
}).catchError((onError) { |
|
|
}).catchError((onError) { |
|
|
|
|
|
var errorMessage = AppException.handleError(onError, |
|
|
|
|
|
customMessageError: "Sai mật khẩu hiện tại"); |
|
|
_scaffoldKey.currentState.showSnackBar(SnackBar( |
|
|
_scaffoldKey.currentState.showSnackBar(SnackBar( |
|
|
content: Row( |
|
|
content: Row( |
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
children: <Widget>[ |
|
|
children: <Widget>[ |
|
|
Text('Cập nhật không thành công.'), |
|
|
|
|
|
|
|
|
Flexible( |
|
|
|
|
|
child: Text(errorMessage), |
|
|
|
|
|
), |
|
|
Icon(Icons.error), |
|
|
Icon(Icons.error), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |