2024-07-11 20:01:38 +05:30
|
|
|
import 'package:regroup/Common/api_urls.dart';
|
2024-07-10 15:02:09 +05:30
|
|
|
import 'package:regroup/Common/base_manager.dart';
|
|
|
|
|
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
|
|
|
|
|
|
|
|
|
class ForgotPassAPI {
|
|
|
|
|
ForgotPassAPI();
|
|
|
|
|
// class otpAPI {
|
|
|
|
|
// otpAPI(this.data);
|
|
|
|
|
// var data;
|
|
|
|
|
Future<ResponseData<dynamic>> requestotp(var data) async {
|
|
|
|
|
final response = await NetworkApiServices().postApi(
|
|
|
|
|
data,
|
2024-07-11 20:01:38 +05:30
|
|
|
ApiUrls.forgotpassword,
|
|
|
|
|
// "https://regroup.betadelivery.com/api/v1/forgot-password",
|
2024-07-10 15:02:09 +05:30
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (response.status == ResponseStatus.SUCCESS) {
|
|
|
|
|
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
|
|
|
|
if (response.data['status'] == "success") {
|
|
|
|
|
return ResponseData<dynamic>(
|
2024-07-12 20:13:56 +05:30
|
|
|
response.data['message'], ResponseStatus.SUCCESS,
|
|
|
|
|
data: response.data);
|
2024-07-10 15:02:09 +05:30
|
|
|
} else {
|
|
|
|
|
return ResponseData<dynamic>(
|
|
|
|
|
response.data['message'], ResponseStatus.FAILED);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<ResponseData<dynamic>> verifyotp(var data) async {
|
|
|
|
|
final response = await NetworkApiServices().postApi(
|
|
|
|
|
data,
|
2024-07-11 20:01:38 +05:30
|
|
|
ApiUrls.verifyotp,
|
|
|
|
|
// "https://regroup.betadelivery.com/api/v1/forgot-password/verify-otp",
|
2024-07-10 15:02:09 +05:30
|
|
|
);
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|