51 lines
1.5 KiB
Dart
51 lines
1.5 KiB
Dart
import 'package:regroup/Common/base_manager.dart';
|
|
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
class ForgotPassAPI {
|
|
ForgotPassAPI();
|
|
// class otpAPI {
|
|
// otpAPI(this.data);
|
|
// var data;
|
|
Future<ResponseData<dynamic>> requestotp(var data) async {
|
|
final response = await NetworkApiServices().postApi(
|
|
data,
|
|
"https://regroup.betadelivery.com/api/v1/forgot-password",
|
|
);
|
|
|
|
if (response.status == ResponseStatus.SUCCESS) {
|
|
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
|
if (response.data['status'] == "success") {
|
|
return ResponseData<dynamic>(
|
|
response.data['message'], ResponseStatus.SUCCESS,data: response.data);
|
|
} else {
|
|
return ResponseData<dynamic>(
|
|
response.data['message'], ResponseStatus.FAILED);
|
|
}
|
|
}
|
|
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData<dynamic>> verifyotp(var data) async {
|
|
final response = await NetworkApiServices().postApi(
|
|
data,
|
|
"https://regroup.betadelivery.com/api/v1/forgot-password/verify-otp",
|
|
);
|
|
|
|
if (response.status == ResponseStatus.SUCCESS) {
|
|
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
|
if (response.data['status'] == "success") {
|
|
return ResponseData<dynamic>(
|
|
response.data['message'], ResponseStatus.SUCCESS);
|
|
} else {
|
|
return ResponseData<dynamic>(
|
|
response.data['message'], ResponseStatus.FAILED);
|
|
}
|
|
}
|
|
|
|
return response;
|
|
}
|
|
}
|
|
|