Nuevos cambios hechos de diseño
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/addon_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/dummy_data/allProducts.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class AddonRepository{
|
||||
|
||||
Future<List<AddonResponse>> getAddonList()async{
|
||||
$();
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/addon-list");
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
print("getAddonList url "+url.toString());
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
print("getAddonList res "+response.body.toString());
|
||||
return addonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/country_response.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
class AddressRepository {
|
||||
|
||||
Future<CountryResponse> getCountryList() async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/countries");
|
||||
final response = await http.get(url);
|
||||
|
||||
|
||||
return countryResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
}
|
||||
174
desarrollo2/source_code/lib/repositories/auth_repository.dart
Normal file
174
desarrollo2/source_code/lib/repositories/auth_repository.dart
Normal file
@@ -0,0 +1,174 @@
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/login_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/logout_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/password_confirm_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/password_forget_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/resend_code_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/user_by_token.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class AuthRepository {
|
||||
|
||||
Future<CommonResponse> getRegResponse({
|
||||
required String name,
|
||||
required String email,
|
||||
required String password,
|
||||
required String confirmPassword,
|
||||
required String shopName,
|
||||
required String address,
|
||||
}) async {
|
||||
var post_body = jsonEncode({
|
||||
"name" : name,
|
||||
"email" : email,
|
||||
"password" : password,
|
||||
"password_confirmation":confirmPassword,
|
||||
"shop_name" : shopName,
|
||||
"address":address
|
||||
});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/shops/create");
|
||||
|
||||
//print("login url " + url.toString());
|
||||
// print("login body " + post_body.toString());
|
||||
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
//print("login re ${response.body}");
|
||||
return commonResponseFromJson(
|
||||
response.body);
|
||||
}
|
||||
|
||||
Future<LoginResponse> getLoginResponse(
|
||||
@required String? email, @required String password) async {
|
||||
var post_body = jsonEncode({
|
||||
"email": "${email}",
|
||||
"password": "$password",
|
||||
"identity_matrix": AppConfig.purchase_code,
|
||||
"user_type": "seller"
|
||||
});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/auth/login");
|
||||
|
||||
//print("login url " + url.toString());
|
||||
// print("login body " + post_body.toString());
|
||||
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
//print("login re ${response.body}");
|
||||
return loginResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<LogoutResponse> getLogoutResponse() async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/auth/logout");
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
);
|
||||
|
||||
// print(response.body);
|
||||
|
||||
return logoutResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<UserByTokenResponse> getUserByTokenResponse() async {
|
||||
var post_body = jsonEncode({"access_token": "${access_token.$}"});
|
||||
print(post_body);
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/get-user-by-access_token");
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
body: post_body);
|
||||
print(response.body);
|
||||
|
||||
return userByTokenResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<PasswordForgetResponse> getPasswordForgetResponse(
|
||||
@required String? email_or_phone, @required String send_code_by) async {
|
||||
var post_body = jsonEncode(
|
||||
{"email_or_phone": "$email_or_phone", "send_code_by": "$send_code_by"});
|
||||
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/auth/password/forget_request",
|
||||
);
|
||||
|
||||
print("forget pass url ${url.toString()}");
|
||||
print("forget pass body ${post_body.toString()}");
|
||||
|
||||
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
print("response.body.toString()${response.body.toString()}");
|
||||
|
||||
return passwordForgetResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<PasswordConfirmResponse> getPasswordConfirmResponse(
|
||||
@required String verification_code, @required String password) async {
|
||||
var post_body = jsonEncode(
|
||||
{"verification_code": "$verification_code", "password": "$password"});
|
||||
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/auth/password/confirm_reset",
|
||||
);
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
return passwordConfirmResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<ResendCodeResponse> getPasswordResendCodeResponse(
|
||||
@required String? email_or_code, @required String verify_by) async {
|
||||
var post_body = jsonEncode(
|
||||
{"email_or_code": "$email_or_code", "verify_by": "$verify_by"});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/auth/password/resend_code");
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
return resendCodeResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/business_setting_response.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
|
||||
|
||||
class BusinessSettingRepository{
|
||||
Future<List<BusinessSettingListResponse>> getBusinessSettingList()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/business-settings");
|
||||
|
||||
var businessSettings = [
|
||||
"conversation_system",
|
||||
"coupon_system",
|
||||
"product_manage_by_admin",
|
||||
"shipping_type"
|
||||
];
|
||||
String params= businessSettings.join(',');
|
||||
var body = {
|
||||
//'keys':params
|
||||
"keys":params
|
||||
};
|
||||
print("business ${body}");
|
||||
var response = await http.post(url,body: body);
|
||||
|
||||
print("business ${response.body}");
|
||||
|
||||
return businessSettingListResponseFromJson(response.body);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/chat_list_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/messages_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class ChatRepository {
|
||||
Future<ChatListResponse> getChatList() async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/conversations");
|
||||
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
},
|
||||
);
|
||||
|
||||
print("chat list "+response.body.toString());
|
||||
|
||||
return chatListResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<MessageResponse> getMessages(id) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/conversations/show/$id");
|
||||
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
},
|
||||
);
|
||||
|
||||
print("chat list "+response.body.toString());
|
||||
|
||||
return messageResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> sendMessages(@required id,@required message) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/conversations/message/store");
|
||||
|
||||
var post_body = jsonEncode({
|
||||
"conversation_id":id,
|
||||
"message":message
|
||||
});
|
||||
print(post_body);
|
||||
|
||||
final response = await http.post(
|
||||
url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
},
|
||||
body: post_body
|
||||
);
|
||||
|
||||
print("chat list "+response.body.toString());
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/commission_history_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart'as http;
|
||||
|
||||
class CommissionRepository{
|
||||
|
||||
Future<CommissionHistoryResponse> getList({int page =1})async{
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/commission-list?page=$page");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
final response = await http.get(url, headers:header );
|
||||
print("create coupon res "+response.body);
|
||||
return commissionHistoryResponseFromJson(response.body);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
122
desarrollo2/source_code/lib/repositories/coupon_repository.dart
Normal file
122
desarrollo2/source_code/lib/repositories/coupon_repository.dart
Normal file
@@ -0,0 +1,122 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/coupon_create_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/coupon_list_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/edit_coupon_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product_for_coupon_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/products_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart'as http;
|
||||
|
||||
|
||||
class CouponRepository{
|
||||
|
||||
|
||||
Future<CouponListResponse> getCoupons() async {
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/coupon/all");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
final response = await http.get(url, headers:header );
|
||||
print("create coupon res "+response.body);
|
||||
return couponListResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<CouponCreateResponse> createCoupon(var post_body) async {
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/coupon/create");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
};
|
||||
print("create coupon body "+post_body);
|
||||
|
||||
final response = await http.post(url, headers:header,body: post_body );
|
||||
|
||||
print("create coupon res "+response.body);
|
||||
|
||||
return couponCreateResponseFromJson(response.body);
|
||||
|
||||
}
|
||||
|
||||
Future<EditCouponResponse> editCoupon(String? id) async {
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/coupon/edit/$id");
|
||||
|
||||
Map<String,String> header= {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:header);
|
||||
|
||||
print("edit coupon"+response.body.toString());
|
||||
|
||||
return editCouponResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CouponCreateResponse> updateCoupon(var post_body,String id) async {
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/coupon/update/$id");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json"
|
||||
};
|
||||
print("update coupon body "+post_body);
|
||||
print("update coupon url "+url.toString());
|
||||
|
||||
final response = await http.post(url, headers:header,body: post_body );
|
||||
|
||||
print("update coupon res "+response.body);
|
||||
|
||||
return couponCreateResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> deleteCoupon(String id) async {
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/coupon/delete/$id");
|
||||
|
||||
Map<String,String> header= {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:header);
|
||||
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<ProductForCouponResponse> searchProducts(String name)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/coupon/for-product?coupon_type=product_base&name=$name");
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
print("product res "+response.body.toString());
|
||||
return productForCouponResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/simple_image_upload_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class FileRepository {
|
||||
Future<SimpleImageUploadResponse> getSimpleImageUploadResponse(
|
||||
@required String image, @required String filename) async {
|
||||
var post_body = jsonEncode({"image": "${image}", "filename": "$filename"});
|
||||
//print(post_body.toString());
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/file/image-upload");
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
//print(response.body.toString());
|
||||
return simpleImageUploadResponseFromJson(response.body);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/uploaded_file_list_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/profile_image_update_response.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FileUploadRepository{
|
||||
|
||||
Future<CommonResponse> fileUpload(File file) async {
|
||||
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/file/upload");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "multipart/form-data; boundary=<calculated when request is sent>",
|
||||
"Accept": "*/*",
|
||||
};
|
||||
|
||||
final httpReq = http.MultipartRequest("POST",url);
|
||||
httpReq.headers.addAll(header);
|
||||
|
||||
|
||||
|
||||
final image = await http.MultipartFile.fromPath("aiz_file", file.path);
|
||||
|
||||
httpReq.files.add(image);
|
||||
|
||||
final response = await httpReq.send();
|
||||
var commonResponse = CommonResponse(result: false,message: "File upload failed");
|
||||
|
||||
|
||||
var responseDecode = await response.stream.bytesToString();
|
||||
|
||||
|
||||
|
||||
if(response.statusCode==200){
|
||||
try {
|
||||
commonResponse = commonResponseFromJson(responseDecode);
|
||||
} on Exception catch (e) {
|
||||
debugPrint(e.toString());
|
||||
}
|
||||
}
|
||||
return commonResponse;
|
||||
}
|
||||
|
||||
Future<UploadedFilesListResponse> getFiles(page,search,type,sort) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/file/all?page=$page&search=$search&type=$type&sort=$sort");
|
||||
final response = await http.get(url,
|
||||
headers: {"Content-Type": "application/json", "Authorization": "Bearer ${access_token.$}","App-Language": app_language.$!,});
|
||||
|
||||
|
||||
return uploadedFilesListResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> deleteFile(id) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/file/delete/$id");
|
||||
final response = await http.get(url,
|
||||
headers: {"Content-Type": "application/json", "Authorization": "Bearer ${access_token.$}","App-Language": app_language.$!,});
|
||||
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/google_location_details_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/location_autocomplete_response.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class GoogleMapLocationRepository{
|
||||
var GoogleMapAPIKey = "";
|
||||
|
||||
Future<GoogleLocationAutoCompleteResponse> getAutoCompleteAddress(String text)async{
|
||||
Uri url = Uri.parse("https://maps.googleapis.com/maps/api/place/queryautocomplete/json?input=$text&key=${GoogleMapAPIKey}");
|
||||
var response = await http.get(url);
|
||||
return googleLocationAutoCompleteResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<GoogleLocationDetailsResponse> getAddressDetails(String placeId)async{
|
||||
Uri url = Uri.parse("https://maps.googleapis.com/maps/api/place/details/json?place_id=$placeId&key=${GoogleMapAPIKey}");
|
||||
var response = await http.get(url);
|
||||
return googleLocationDetailsResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/language_list_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
|
||||
class LanguageRepository {
|
||||
Future<LanguageListResponse> getLanguageList() async {
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/languages");
|
||||
final response = await http.get(url,headers: {
|
||||
"App-Language": app_language.$!,
|
||||
}
|
||||
);
|
||||
//print(response.body.toString());
|
||||
return languageListResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/order_detail_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/order_mini_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class OrderRepository {
|
||||
Future<OrderListResponse> getOrderList(
|
||||
{page = 1, payment_status = "", delivery_status = ""}) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/orders" +
|
||||
"?page=${page}&payment_status=${payment_status}&delivery_status=${delivery_status}");
|
||||
|
||||
print("get order list url "+url.toString());
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!,
|
||||
});
|
||||
return orderListResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<OrderDetailResponse> getOrderDetails({@required int? id = 0}) async {
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL_WITH_PREFIX}/orders/details/" + id.toString());
|
||||
print("details url:" + url.toString());
|
||||
final response = await http.get(url, headers: {
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!,
|
||||
});
|
||||
//print("url:" +url.toString());
|
||||
print("order details " + response.body);
|
||||
return orderDetailResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> updateDeliveryStatus({@required int? id = 0, required String status,String? paymentType=""}) async {
|
||||
Uri url =
|
||||
Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/orders/update-delivery-status");
|
||||
|
||||
var post_body = jsonEncode({"order_id": "$id", "status": "$status","payment_type":paymentType});
|
||||
print(post_body);
|
||||
|
||||
final response = await http.post(url, body: post_body, headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!,
|
||||
});
|
||||
print("update result" + response.body);
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<CommonResponse> updatePaymentStatus({@required int? id = 0, required String status}) async {
|
||||
Uri url =
|
||||
Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/orders/update-payment-status");
|
||||
|
||||
var post_body = jsonEncode({"order_id": "$id", "status": "$status"});
|
||||
|
||||
final response = await http.post(url, body: post_body, headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!,
|
||||
});
|
||||
print("update result" + response.body);
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payment_history_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class PaymentHistoryRepository{
|
||||
|
||||
Future<PaymentHistoryResponse> getList({int page=1})async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/payment-history" +
|
||||
"?page=${page}");
|
||||
|
||||
print("get order list url "+url.toString());
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!,
|
||||
});
|
||||
return paymentHistoryResponseFromJson(response.body);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
295
desarrollo2/source_code/lib/repositories/payment_repository.dart
Normal file
295
desarrollo2/source_code/lib/repositories/payment_repository.dart
Normal file
@@ -0,0 +1,295 @@
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/offline_payment_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payment_type_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/bkash_begin_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/bkash_payment_process_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/flutterwave_url_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/iyzico_payment_success_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/nagad_begin_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/nagad_payment_process_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/paypal_url_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/paystack_payment_success_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/razorpay_payment_success_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payments/sslcommerz_begin_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
|
||||
class PaymentRepository {
|
||||
Future<List<PaymentTypeResponse>> getPaymentResponseList({mode = "", list = "both"})async{
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/payment-types?mode=${mode}&list=${list}");
|
||||
print(url.toString()+ " url.toString()");
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}"
|
||||
});
|
||||
|
||||
|
||||
// print("payment-types"+response.body.toString());
|
||||
|
||||
return paymentTypeResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<PaypalUrlResponse> getPaypalUrlResponse(@required String payment_type,
|
||||
@required int combined_order_id,@required var package_id, @required double amount) async {
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/paypal/payment/url?payment_type=${payment_type}&combined_order_id=${combined_order_id}&amount=${amount}&user_id=${seller_id.$}&package_id=${package_id}",
|
||||
);
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
});
|
||||
|
||||
return paypalUrlResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<FlutterwaveUrlResponse> getFlutterwaveUrlResponse(
|
||||
@required String payment_type,
|
||||
@required int combined_order_id,
|
||||
@required var package_id,
|
||||
@required double amount) async {
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/flutterwave/payment/url?payment_type=${payment_type}&combined_order_id=${combined_order_id}&amount=${amount}&user_id=${seller_id.$}&package_id=${package_id}");
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
});
|
||||
|
||||
//print(url);
|
||||
//print(response.body.toString());
|
||||
return flutterwaveUrlResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<RazorpayPaymentSuccessResponse> getRazorpayPaymentSuccessResponse(
|
||||
@required payment_type,
|
||||
@required double amount,
|
||||
@required int combined_order_id,
|
||||
@required String? payment_details) async {
|
||||
var post_body = jsonEncode({
|
||||
"user_id": "${seller_id.$}",
|
||||
"payment_type": "${payment_type}",
|
||||
"combined_order_id": "${combined_order_id}",
|
||||
"amount": "${amount}",
|
||||
"payment_details": "${payment_details}"
|
||||
});
|
||||
|
||||
print(post_body.toString());
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/razorpay/success");
|
||||
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
//print(response.body.toString());
|
||||
return razorpayPaymentSuccessResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<PaystackPaymentSuccessResponse> getPaystackPaymentSuccessResponse(
|
||||
@required payment_type,
|
||||
@required double amount,
|
||||
@required int combined_order_id,
|
||||
@required String? payment_details) async {
|
||||
var post_body = jsonEncode({
|
||||
"user_id": "${seller_id.$}",
|
||||
"payment_type": "${payment_type}",
|
||||
"combined_order_id": "${combined_order_id}",
|
||||
"amount": "${amount}",
|
||||
"payment_details": "${payment_details}"
|
||||
});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/paystack/success");
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}"
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
//print(response.body.toString());
|
||||
return paystackPaymentSuccessResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<IyzicoPaymentSuccessResponse> getIyzicoPaymentSuccessResponse(
|
||||
@required payment_type,
|
||||
@required double amount,
|
||||
@required int combined_order_id,
|
||||
@required String? payment_details) async {
|
||||
var post_body = jsonEncode({
|
||||
"user_id": "${seller_id.$}",
|
||||
"payment_type": "${payment_type}",
|
||||
"combined_order_id": "${combined_order_id}",
|
||||
"amount": "${amount}",
|
||||
"payment_details": "${payment_details}"
|
||||
});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/paystack/success");
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}"
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
//print(response.body.toString());
|
||||
return iyzicoPaymentSuccessResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<BkashBeginResponse> getBkashBeginResponse(
|
||||
@required String payment_type,
|
||||
@required int combined_order_id,
|
||||
@required var package_id,
|
||||
@required double amount) async {
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/bkash/begin?payment_type=${payment_type}&combined_order_id=${combined_order_id}&amount=${amount}&user_id=${seller_id.$}&package_id=${package_id}");
|
||||
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {"Authorization": "Bearer ${access_token.$}"},
|
||||
);
|
||||
|
||||
print(response.body.toString());
|
||||
return bkashBeginResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<BkashPaymentProcessResponse> getBkashPaymentProcessResponse(
|
||||
{
|
||||
required payment_type,
|
||||
required double amount,
|
||||
required int combined_order_id,
|
||||
required String? payment_id,
|
||||
required String? token,
|
||||
required String? package_id,
|
||||
}) async {
|
||||
var post_body = jsonEncode({
|
||||
"user_id": "${seller_id.$}",
|
||||
"payment_type": "${payment_type}",
|
||||
"combined_order_id": "${combined_order_id}",
|
||||
"package_id": "${package_id}",
|
||||
"amount": "${amount}",
|
||||
"payment_id": "${payment_id}",
|
||||
"token": "${token}"
|
||||
});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/bkash/api/success");
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
//print(response.body.toString());
|
||||
return bkashPaymentProcessResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<SslcommerzBeginResponse> getSslcommerzBeginResponse(
|
||||
@required String payment_type,
|
||||
@required int combined_order_id,
|
||||
@required String package_id,
|
||||
@required double amount) async {
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/sslcommerz/begin?payment_type=${payment_type}&combined_order_id=${combined_order_id}&amount=${amount}&user_id=${seller_id.$}&package_id=${package_id}");
|
||||
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!
|
||||
},
|
||||
);
|
||||
|
||||
print(response.body.toString());
|
||||
return sslcommerzBeginResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<NagadBeginResponse> getNagadBeginResponse(
|
||||
@required String payment_type,
|
||||
@required int combined_order_id,
|
||||
@required var package_id,
|
||||
@required double amount) async {
|
||||
Uri url = Uri.parse(
|
||||
"${AppConfig.BASE_URL}/nagad/begin?payment_type=${payment_type}&combined_order_id=${combined_order_id}&amount=${amount}&user_id=${seller_id.$}&package_id=${package_id}");
|
||||
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!
|
||||
},
|
||||
);
|
||||
|
||||
print(response.body.toString());
|
||||
return nagadBeginResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<NagadPaymentProcessResponse> getNagadPaymentProcessResponse(
|
||||
@required payment_type,
|
||||
@required double amount,
|
||||
@required int combined_order_id,
|
||||
@required String? payment_details) async {
|
||||
var post_body = jsonEncode({
|
||||
"user_id": "${seller_id.$}",
|
||||
"payment_type": "${payment_type}",
|
||||
"combined_order_id": "${combined_order_id}",
|
||||
"amount": "${amount}",
|
||||
"payment_details": "${payment_details}"
|
||||
});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/nagad/process");
|
||||
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!,
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
//print(response.body.toString());
|
||||
return nagadPaymentProcessResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Future<OfflinePaymentResponse> getOfflinePaymentResponse({required String amount,
|
||||
required String name,
|
||||
required String trx_id,
|
||||
required int? package_id,
|
||||
|
||||
required int? photo})async{
|
||||
|
||||
var post_body = jsonEncode({
|
||||
"package_id":package_id,
|
||||
"amount": "$amount",
|
||||
"payment_option": "Offline Payment",
|
||||
"trx_id": "$trx_id",
|
||||
"photo": "$photo",
|
||||
});
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/seller-package/offline-payment");
|
||||
print("offline payment url "+url.toString());
|
||||
print("offline payment access token "+access_token.$!);
|
||||
print("offline payment url "+post_body.toString());
|
||||
final response = await http.post(url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"App-Language": app_language.$!
|
||||
},
|
||||
body: post_body);
|
||||
|
||||
print("hello Offline wallet recharge" + response.body.toString());
|
||||
return offlinePaymentResponseFromJson(response.body);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/payment_type_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class PaymentTypeRepository{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
383
desarrollo2/source_code/lib/repositories/product_repository.dart
Normal file
383
desarrollo2/source_code/lib/repositories/product_repository.dart
Normal file
@@ -0,0 +1,383 @@
|
||||
|
||||
import 'dart:convert';
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product/attribute_response_model.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product/brand_response_model.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product/category_response_model.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product/color_response_model.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product/product_edit_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product_delete_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product_duplicate_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product_for_coupon_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/product_review_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/products_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/remainig_product_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/whole_sale_product_details_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class ProductRepository{
|
||||
|
||||
Future<ProductsResponse> getProducts(
|
||||
{ name = "", page = 1}) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/all"
|
||||
"?page=${page}&name=${name}");
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
});
|
||||
//print("product res "+response.body.toString());
|
||||
return productsResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<ProductsResponse> getWholesaleProducts(
|
||||
{ name = "", page = 1}) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/wholesale-products"
|
||||
"?page=${page}&name=${name}");
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
});
|
||||
return productsResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Future<ProductEditResponse> productEdit({required id,lang="en"}) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/edit/$id?lang=$lang");
|
||||
|
||||
//print("product url "+url.toString());
|
||||
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
});
|
||||
//print("product res "+response.body.toString());
|
||||
return productEditResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<WholesaleProductDetailsResponse> wholesaleProductEdit({required id,lang="en"}) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/wholesale-product/edit/$id?lang=$lang");
|
||||
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
});
|
||||
print("product res "+response.body.toString());
|
||||
return wholesaleProductDetailsResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> addProductResponse(postBody)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/add");
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json",
|
||||
"Accept":"application/json"
|
||||
};
|
||||
|
||||
//print(postBody);
|
||||
//print(access_token.$);
|
||||
|
||||
|
||||
final response = await http.post(url, headers:reqHeader,body: postBody
|
||||
);
|
||||
|
||||
//print("product res "+response.body.toString());
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> updateProductResponse(postBody,productId,lang)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/update/$productId?lang=$lang");
|
||||
//print(url.toString());
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json",
|
||||
"Accept":"application/json"
|
||||
};
|
||||
|
||||
//print(productId);
|
||||
//print(postBody);
|
||||
//print(access_token.$);
|
||||
|
||||
|
||||
final response = await http.post(url, headers:reqHeader,body: postBody
|
||||
);
|
||||
|
||||
//print("product res "+response.body.toString());
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> updateWholesaleProductResponse(postBody,productId,lang)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/wholesale-product/update/$productId?lang=$lang");
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json",
|
||||
"Accept":"application/json"
|
||||
};
|
||||
final response = await http.post(url, headers:reqHeader,body: postBody);
|
||||
print(response.body);
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> addWholeSaleProductResponse(postBody)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/wholesale-product/create");
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json",
|
||||
"Accept":"application/json"
|
||||
};
|
||||
|
||||
print(postBody);
|
||||
print(access_token.$);
|
||||
print(url.toString());
|
||||
|
||||
|
||||
final response = await http.post(url, headers:reqHeader,body: postBody
|
||||
);
|
||||
print(response.body);
|
||||
return commonResponseFromJson(response.body);
|
||||
|
||||
}
|
||||
|
||||
Future<CommonResponse> updateWholeSaleProductResponse(postBody,productId,lang)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/update/$productId?lang=$lang");
|
||||
//print(url.toString());
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json",
|
||||
"Accept":"application/json"
|
||||
};
|
||||
|
||||
//print(productId);
|
||||
//print(postBody);
|
||||
//print(access_token.$);
|
||||
|
||||
|
||||
final response = await http.post(url, headers:reqHeader,body: postBody);
|
||||
|
||||
//print("product res "+response.body.toString());
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
productDuplicateReq({required id})async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/product/duplicate/$id");
|
||||
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
});
|
||||
//print("product res "+response.body.toString());
|
||||
return productDuplicateResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
productDeleteReq({required id})async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/product/delete/$id");
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
});
|
||||
//print("product res "+response.body.toString());
|
||||
return deleteProductFromJson(response.body);
|
||||
}
|
||||
|
||||
wholesaleProductDeleteReq({required id})async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/wholesale-product/destroy/$id");
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
});
|
||||
print("product res "+response.body.toString());
|
||||
return deleteProductFromJson(response.body);
|
||||
}
|
||||
|
||||
productStatusChangeReq({required id,status})async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/product/change-status");
|
||||
|
||||
var post_body = jsonEncode({
|
||||
"id": id,
|
||||
"status":status
|
||||
});
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.post(url, headers:reqHeader ,body: post_body
|
||||
);
|
||||
|
||||
|
||||
//print("product res "+response.body.toString());
|
||||
return deleteProductFromJson(response.body);
|
||||
}
|
||||
|
||||
productFeaturedChangeReq({required id,required featured})async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/product/change-featured");
|
||||
|
||||
var post_body = jsonEncode({
|
||||
"id": id,
|
||||
"featured_status":featured
|
||||
});
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.post(url, headers:reqHeader ,body: post_body
|
||||
);
|
||||
|
||||
|
||||
//print("product res "+response.body.toString());
|
||||
return deleteProductFromJson(response.body);
|
||||
}
|
||||
|
||||
remainingUploadProducts()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/remaining-uploads");
|
||||
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
//print("product res "+response.body.toString());
|
||||
return remainingProductFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<ProductReviewResponse> getProductReviewsReq()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/reviews");
|
||||
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
//print("product res "+response.body.toString());
|
||||
return productReviewResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<CategoryResponse> getCategoryRes()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/categories");
|
||||
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
//print("product res "+response.body.toString());
|
||||
|
||||
return categoryResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<BrandResponse> getBrandRes()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/brands");
|
||||
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
//print("product res "+response.body.toString());
|
||||
|
||||
return brandResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<BrandResponse> getTaxRes()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/taxes");
|
||||
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
//print("product res "+response.body.toString());
|
||||
|
||||
return brandResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<AttributeResponse> getAttributeRes()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/attributes");
|
||||
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
//print("product res "+response.body.toString());
|
||||
|
||||
return attributeResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<ColorResponse> getColorsRes()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/products/colors");
|
||||
|
||||
var reqHeader={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type":"application/json"
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:reqHeader
|
||||
);
|
||||
//print("product res "+response.body.toString());
|
||||
|
||||
return colorResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/phone_email_availability_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/profile_image_update_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/profile_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/profile_update_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class ProfileRepository {
|
||||
Future<SellerProfileResponse> getSellerInfo() async {
|
||||
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/profile");
|
||||
final response = await http.get(url,
|
||||
headers: {"Content-Type": "application/json", "Authorization": "Bearer ${access_token.$}","App-Language": app_language.$!,});
|
||||
|
||||
//print(response.body.toString());
|
||||
return sellerProfileResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<ProfileUpdateResponse> getProfileUpdateResponse(
|
||||
@required String name,@required String password) async {
|
||||
|
||||
var post_body = jsonEncode({"name": "${name}", "password": "$password"});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/profile/update");
|
||||
final response = await http.post(url,
|
||||
headers: {"Content-Type": "application/json", "Authorization": "Bearer ${access_token.$}","App-Language": app_language.$!,},body: post_body );
|
||||
|
||||
//print(response.body.toString());
|
||||
return profileUpdateResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<ProfileImageUpdateResponse> getProfileImageUpdateResponse(
|
||||
@required String image,@required String filename) async {
|
||||
|
||||
var post_body = jsonEncode({"image": "${image}", "filename": "$filename"});
|
||||
//print(post_body.toString());
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/profile/update-image");
|
||||
final response = await http.post(url,
|
||||
headers: {"Content-Type": "application/json", "Authorization": "Bearer ${access_token.$}","App-Language": app_language.$!,},body: post_body );
|
||||
|
||||
//print(response.body.toString());
|
||||
return profileImageUpdateResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<PhoneEmailAvailabilityResponse> getPhoneEmailAvailabilityResponse() async {
|
||||
|
||||
//var post_body = jsonEncode({"user_id":"${user_id.$}"});
|
||||
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL}/profile/check-phone-and-email");
|
||||
final response = await http.post(url,
|
||||
headers: {"Authorization": "Bearer ${access_token.$}","App-Language": app_language.$!,});
|
||||
|
||||
print(response.body.toString());
|
||||
return phoneEmailAvailabilityResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/RefundOrderResponse.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class RefundOrderRepository{
|
||||
|
||||
Future<RefundOrderResponse> getRefundOrderList({int page = 0}) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/refunds?page=${page}");
|
||||
|
||||
print("product url "+url.toString());
|
||||
print("user token "+access_token.$!);
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
});
|
||||
print("product res "+response.body.toString());
|
||||
|
||||
return refundOrderResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<CommonResponse> approveRefundSellerStatusRequest(id) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/refunds/approve");
|
||||
|
||||
var post_body = jsonEncode({
|
||||
"refund_id":id
|
||||
});
|
||||
print("refund id ${id}");
|
||||
var header = {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json",
|
||||
};
|
||||
final response = await http.post(url, headers: header,body: post_body);
|
||||
|
||||
print("product res "+response.body.toString());
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> rejectRefundSellerStatusRequest(id,message) async {
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/refunds/reject");
|
||||
|
||||
var post_body = jsonEncode({
|
||||
"refund_id":id,
|
||||
"reject_reason": message
|
||||
});
|
||||
var header = {
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json",
|
||||
|
||||
};
|
||||
final response = await http.post(url,headers: header,body: post_body);
|
||||
|
||||
print("product res "+response.body.toString());
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
151
desarrollo2/source_code/lib/repositories/shop_repository.dart
Normal file
151
desarrollo2/source_code/lib/repositories/shop_repository.dart
Normal file
@@ -0,0 +1,151 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/category_wise_product_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/chart_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/shop_info_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/seller_package_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/shop_package_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/shop_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/top_12_product_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/verification_form_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/dummy_data/categori_wise_product.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class ShopRepository{
|
||||
|
||||
|
||||
static Future<List<VerificationFormResponse>> getFormDataRequest()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/shop-verify-form");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
|
||||
final response = await http.get(url, headers:header );
|
||||
|
||||
return verificationFormResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<Top12ProductResponse> getTop12ProductRequest()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/dashboard/top-12-product");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
final response = await http.get(url, headers:header );
|
||||
return top12ProductResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<List<ChartResponse>> chartRequest()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/dashboard/sales-stat");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
final response = await http.get(url, headers:header );
|
||||
|
||||
print("chartRequest res"+ response.body.toString());
|
||||
return chartResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<SellerPackageResponse> getSellerPackageRequest()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/seller-packages-list");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
|
||||
print("package url "+ url.toString());
|
||||
|
||||
final response = await http.get(url, headers:header );
|
||||
|
||||
print("package res body "+ response.body.toString());
|
||||
|
||||
return sellerPackageResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
Future<CommonResponse> purchaseFreePackageRequest(packageId)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/seller-package/free-package");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json",
|
||||
};
|
||||
|
||||
var post_data= jsonEncode({
|
||||
"package_id":packageId,
|
||||
"payment_option":"No Method",
|
||||
"amount":0
|
||||
});
|
||||
|
||||
final response = await http.post(url, headers:header ,body: post_data);
|
||||
|
||||
|
||||
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<List<CategoryWiseProductResponse>> getCategoryWiseProductRequest()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/dashboard/category-wise-products");
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
final response = await http.get(url, headers:header );
|
||||
return categoryWiseProductResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<ShopInfoResponse> getShopInfo()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/shop/info");
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
final response = await http.get(url, headers:header );
|
||||
print("shop info "+response.body.toString());
|
||||
return shopInfoResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<ShopPackageResponse> getShopPackage()async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/package/info");
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
final response = await http.get(url, headers:header );
|
||||
print("shop info "+response.body.toString());
|
||||
return shopPackageResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
Future<CommonResponse> updateShopSetting(var post_body)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/shop-update");
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json"
|
||||
};
|
||||
|
||||
print("updateShopSetting body"+post_body.toString());
|
||||
|
||||
final response = await http.post(url, headers:header,body: post_body);
|
||||
|
||||
print("shop info "+response.body.toString());
|
||||
return commonResponseFromJson(response.body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/app_config.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/common_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/data_model/withdraw_list_response.dart';
|
||||
import 'package:active_ecommerce_seller_app/helpers/shared_value_helper.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class WithdrawRepository{
|
||||
|
||||
Future<WithdrawListResponse> getList(int page)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/withdraw-request?page=$page");
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
};
|
||||
final response = await http.get(url, headers:header );
|
||||
print("withdraw list "+response.body);
|
||||
return withdrawListResponseFromJson(response.body);
|
||||
|
||||
}
|
||||
|
||||
Future<CommonResponse> sendWithdrawReq(String? message,String? amount)async{
|
||||
Uri url = Uri.parse("${AppConfig.BASE_URL_WITH_PREFIX}/withdraw-request/store");
|
||||
|
||||
var post_body = jsonEncode({"amount": "$amount", "message": "$message"});
|
||||
|
||||
Map<String,String> header={
|
||||
"App-Language": app_language.$!,
|
||||
"Authorization": "Bearer ${access_token.$}",
|
||||
"Content-Type": "application/json",
|
||||
};
|
||||
|
||||
final response = await http.post(url, headers:header ,body: post_body);
|
||||
print("withdraw list "+response.body);
|
||||
return commonResponseFromJson(response.body);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user