97 lines
2.8 KiB
Dart
97 lines
2.8 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:get/get.dart';
|
|
import 'api_provider_base.dart';
|
|
|
|
class ApiProvider extends BaseProvider {
|
|
Future<Response> getVerificationCode(String countryCode, String account,
|
|
String channel, String codeType, String uniqueid, String xWidth) =>
|
|
post(
|
|
getVerificationCodeUrl.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
"channel": channel,
|
|
'codeType': codeType,
|
|
"uniqueid": uniqueid,
|
|
'xWidth': xWidth,
|
|
}));
|
|
|
|
Future<Response> register(String countryCode, String countryId, String mobile,
|
|
String password, String uniqueid, String verificationCode) =>
|
|
post(registerUrl.toUrl, null, query: {
|
|
'countryCode': countryCode,
|
|
'countryId': countryId,
|
|
"mobile": mobile,
|
|
'password': password,
|
|
'platId': "2",
|
|
"uniqueid": uniqueid,
|
|
'verificationCode': verificationCode,
|
|
});
|
|
|
|
// post(
|
|
// registerUrl.toUrl,
|
|
// jsonEncode({
|
|
// 'countryCode': countryCode,
|
|
// 'countryId': countryId,
|
|
// "mobile": mobile,
|
|
// 'password': password,
|
|
// 'platId': "2",
|
|
// "uniqueid": uniqueid,
|
|
// 'verificationCode': verificationCode,
|
|
// }));
|
|
|
|
Future<Response> getSliderVerifyImg(String countryCode, String account) =>
|
|
post(
|
|
getSliderVerifyImgUrl.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
}));
|
|
|
|
Future<Response> checkSliderVerifyImg(
|
|
String countryCode, String account, String xWidth) =>
|
|
post(
|
|
checkImgUrl.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
'xWidth': xWidth,
|
|
}));
|
|
|
|
Future<Response> login(String loginType, String password, String countryCode,
|
|
String username) =>
|
|
post(
|
|
loginUrl.toUrl,
|
|
jsonEncode({
|
|
'loginType': loginType,
|
|
'password': password,
|
|
"platId": "2",
|
|
'uniqueid': "477E6814-289D-402A-9F49-F89A8BD05D63",
|
|
'countryCode': countryCode,
|
|
"username": username
|
|
}));
|
|
|
|
Future<Response> resetPassword(
|
|
String countryCode,
|
|
String account,
|
|
String date,
|
|
String newPassword,
|
|
String uniqueid,
|
|
String verificationCode) =>
|
|
post(
|
|
resetPasswordURL.toUrl,
|
|
jsonEncode({
|
|
'countryCode': countryCode,
|
|
'account': account,
|
|
"date": date,
|
|
'newPassword': newPassword,
|
|
"uniqueid": uniqueid,
|
|
'verificationCode': verificationCode,
|
|
}));
|
|
}
|
|
|
|
extension ExtensionString on String {
|
|
String get toUrl => '$this';
|
|
}
|