This commit is contained in:
Rajshinde046
2024-06-04 15:56:01 +05:30
parent 507f297b73
commit 3d9e71cbba
10 changed files with 644 additions and 90 deletions

View File

@@ -88,4 +88,7 @@ class ApiUrls {
//Stock Details
static String subscriptionApi = "${base}my-subscription-page";
//setting
static String setting = "${base}update-notification";
}

View File

@@ -7,6 +7,7 @@ import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_branch_sdk/flutter_branch_sdk.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -77,6 +78,8 @@ class MyApp extends StatefulWidget {
}
class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
StreamSubscription<Map>? streamSubscription;
StreamController<String> controllerData = StreamController<String>();
var _connectionStatus = ConnectivityResult.values.toString();
late StreamSubscription<ConnectivityResult> subscription;
Connectivity connectivity = Connectivity();
@@ -109,6 +112,30 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
// print(_connectionStatus);
}
void listenDynamicLinks() async {
streamSubscription = FlutterBranchSdk.initSession().listen((data) {
print('listenDynamicLinks - DeepLink Data: $data');
controllerData.sink.add((data.toString()));
if (data.containsKey('+clicked_branch_link') &&
data['+clicked_branch_link'] == true) {
debugPrint(
'------------------------------------Link clicked----------------------------------------------');
// debugPrint('Custom string: ${data['custom_string']}');
debugPrint('Custom number: ${data['custom_number']}');
debugPrint("var type is ${data['custom_number'].runtimeType}");
debugPrint(
'------------------------------------------------------------------------------------------------');
// showSnackBar(
// message: 'Link clicked: Custom string - ${data['custom_string']}',
// duration: 10);
// Get.to(() =>
// SvpMain(fromHome: false, index: int.parse(data['custom_number'])));
}
}, onError: (error) {
print('InitSesseion error: ${error.toString()}');
});
}
Future<void> checkInternet() async {
final connectivityResult = await (Connectivity().checkConnectivity());

View File

@@ -30,18 +30,18 @@ class Data {
int? principalTypeXid;
int? principalSourceXid;
String? userName;
Null? gender;
String? gender;
String? dateOfBirth;
String? phoneNumber;
Null? otherPhoneNumber;
String? otherPhoneNumber;
String? emailAddress;
Null? addressLine1;
Null? addressLine2;
String? addressLine1;
String? addressLine2;
String? city;
Null? postCode;
String? postCode;
String? profilePhoto;
Null? referralCode;
Null? description;
String? referralCode;
String? description;
int? whatsappUpdate;
int? profileUpdated;
int? riskProfileUpdated;
@@ -50,6 +50,13 @@ class Data {
String? playerId;
int? notificationAlert;
String? isActive;
bool? isSubscriptionTaken;
bool? isSubscriptionCancelled;
SubscriptionData? subscriptionData;
int? alertWhatsAppNotification;
int? alertInAppNotification;
int? alertPushAppNotification;
int? alertSmsAppNotification;
Data(
{this.id,
@@ -75,7 +82,14 @@ class Data {
this.securedAccess,
this.playerId,
this.notificationAlert,
this.isActive});
this.isActive,
this.isSubscriptionTaken,
this.isSubscriptionCancelled,
this.subscriptionData,
this.alertWhatsAppNotification,
this.alertInAppNotification,
this.alertPushAppNotification,
this.alertSmsAppNotification});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
@@ -102,6 +116,15 @@ class Data {
playerId = json['player_id'];
notificationAlert = json['notification_alert'];
isActive = json['is_active'];
isSubscriptionTaken = json['is_subscription_taken'];
isSubscriptionCancelled = json['is_subscription_cancelled'];
subscriptionData = json['subscription_data'] != null
? new SubscriptionData.fromJson(json['subscription_data'])
: null;
alertWhatsAppNotification = json['alert_whats_app_notification'];
alertInAppNotification = json['alert_in_app_notification'];
alertPushAppNotification = json['alert_push_app_notification'];
alertSmsAppNotification = json['alert_sms_app_notification'];
}
Map<String, dynamic> toJson() {
@@ -130,6 +153,254 @@ class Data {
data['player_id'] = this.playerId;
data['notification_alert'] = this.notificationAlert;
data['is_active'] = this.isActive;
data['is_subscription_taken'] = this.isSubscriptionTaken;
data['is_subscription_cancelled'] = this.isSubscriptionCancelled;
if (this.subscriptionData != null) {
data['subscription_data'] = this.subscriptionData!.toJson();
}
data['alert_whats_app_notification'] = this.alertWhatsAppNotification;
data['alert_in_app_notification'] = this.alertInAppNotification;
data['alert_push_app_notification'] = this.alertPushAppNotification;
data['alert_sms_app_notification'] = this.alertSmsAppNotification;
return data;
}
}
class SubscriptionData {
int? id;
int? iamPrincipalXid;
int? manageProductXid;
String? razorpayPlanId;
String? subscriptionId;
String? razorpayCustomerId;
String? status;
String? paymentMethod;
int? quantity;
String? chargeAt;
String? startAt;
String? endAt;
String? totalCount;
int? isCancelledSubscription;
String? cancelledAt;
String? expireBy;
String? shortUrl;
String? hasScheduledChanges;
int? isActive;
String? createdBy;
String? modifiedBy;
String? deletedAt;
String? createdAt;
String? updatedAt;
String? amount;
ProductData? productData;
SubscriptionData(
{this.id,
this.iamPrincipalXid,
this.manageProductXid,
this.razorpayPlanId,
this.subscriptionId,
this.razorpayCustomerId,
this.status,
this.paymentMethod,
this.quantity,
this.chargeAt,
this.startAt,
this.endAt,
this.totalCount,
this.isCancelledSubscription,
this.cancelledAt,
this.expireBy,
this.shortUrl,
this.hasScheduledChanges,
this.isActive,
this.createdBy,
this.modifiedBy,
this.deletedAt,
this.createdAt,
this.updatedAt,
this.amount,
this.productData});
SubscriptionData.fromJson(Map<String, dynamic> json) {
id = json['id'];
iamPrincipalXid = json['iam_principal_xid'];
manageProductXid = json['manage_product_xid'];
razorpayPlanId = json['razorpay_plan_id'];
subscriptionId = json['subscription_id'];
razorpayCustomerId = json['razorpay_customer_id'];
status = json['status'];
paymentMethod = json['payment_method'];
quantity = json['quantity'];
chargeAt = json['charge_at'];
startAt = json['start_at'];
endAt = json['end_at'];
totalCount = json['total_count'];
isCancelledSubscription = json['isCancelledSubscription'];
cancelledAt = json['cancelled_at'];
expireBy = json['expire_by'];
shortUrl = json['short_url'];
hasScheduledChanges = json['has_scheduled_changes'];
isActive = json['is_active'];
createdBy = json['created_by'];
modifiedBy = json['modified_by'];
deletedAt = json['deleted_at'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
amount = json['amount'];
productData = json['product_data'] != null
? new ProductData.fromJson(json['product_data'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['iam_principal_xid'] = this.iamPrincipalXid;
data['manage_product_xid'] = this.manageProductXid;
data['razorpay_plan_id'] = this.razorpayPlanId;
data['subscription_id'] = this.subscriptionId;
data['razorpay_customer_id'] = this.razorpayCustomerId;
data['status'] = this.status;
data['payment_method'] = this.paymentMethod;
data['quantity'] = this.quantity;
data['charge_at'] = this.chargeAt;
data['start_at'] = this.startAt;
data['end_at'] = this.endAt;
data['total_count'] = this.totalCount;
data['isCancelledSubscription'] = this.isCancelledSubscription;
data['cancelled_at'] = this.cancelledAt;
data['expire_by'] = this.expireBy;
data['short_url'] = this.shortUrl;
data['has_scheduled_changes'] = this.hasScheduledChanges;
data['is_active'] = this.isActive;
data['created_by'] = this.createdBy;
data['modified_by'] = this.modifiedBy;
data['deleted_at'] = this.deletedAt;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
data['amount'] = this.amount;
if (this.productData != null) {
data['product_data'] = this.productData!.toJson();
}
return data;
}
}
class ProductData {
int? id;
String? razorpayPlanId;
int? productTypeXid;
int? productTierXid;
String? productName;
String? productDescription;
String? productPrice;
String? productImage;
String? template;
int? isActive;
String? createdBy;
String? modifiedBy;
String? deletedAt;
String? createdAt;
String? updatedAt;
ProductTier? productTier;
ProductData(
{this.id,
this.razorpayPlanId,
this.productTypeXid,
this.productTierXid,
this.productName,
this.productDescription,
this.productPrice,
this.productImage,
this.template,
this.isActive,
this.createdBy,
this.modifiedBy,
this.deletedAt,
this.createdAt,
this.updatedAt,
this.productTier});
ProductData.fromJson(Map<String, dynamic> json) {
id = json['id'];
razorpayPlanId = json['razorpay_plan_id'];
productTypeXid = json['product_type_xid'];
productTierXid = json['product_tier_xid'];
productName = json['product_name'];
productDescription = json['product_description'];
productPrice = json['product_price'];
productImage = json['product_image'];
template = json['template'];
isActive = json['is_active'];
createdBy = json['created_by'];
modifiedBy = json['modified_by'];
deletedAt = json['deleted_at'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
productTier = json['product_tier'] != null
? new ProductTier.fromJson(json['product_tier'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['razorpay_plan_id'] = this.razorpayPlanId;
data['product_type_xid'] = this.productTypeXid;
data['product_tier_xid'] = this.productTierXid;
data['product_name'] = this.productName;
data['product_description'] = this.productDescription;
data['product_price'] = this.productPrice;
data['product_image'] = this.productImage;
data['template'] = this.template;
data['is_active'] = this.isActive;
data['created_by'] = this.createdBy;
data['modified_by'] = this.modifiedBy;
data['deleted_at'] = this.deletedAt;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
if (this.productTier != null) {
data['product_tier'] = this.productTier!.toJson();
}
return data;
}
}
class ProductTier {
int? id;
String? name;
int? isActive;
String? createdAt;
String? updatedAt;
String? deletedAt;
ProductTier(
{this.id,
this.name,
this.isActive,
this.createdAt,
this.updatedAt,
this.deletedAt});
ProductTier.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
isActive = json['is_active'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
deletedAt = json['deleted_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['is_active'] = this.isActive;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
data['deleted_at'] = this.deletedAt;
return data;
}
}

View File

@@ -6,7 +6,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:traderscircuit/Utils/Common/CommonBottomNavigation.dart';
import 'package:traderscircuit/Utils/Common/CommonTabBar.dart';
import 'package:traderscircuit/Utils/Common/commonBotton.dart';
@@ -20,8 +20,10 @@ import 'package:traderscircuit/model/ProductsModel/call_recommendations_model.da
import 'package:traderscircuit/view/MainScreen/MainScreen.dart';
import 'package:traderscircuit/view/MainScreen/stockDetails/stock_details_screen.dart';
import 'package:traderscircuit/view/Sidemenu/Sidemenu.dart';
import 'package:traderscircuit/view/Sidemenu/webview_subscription.dart';
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
import 'package:traderscircuit/view_model/ProductsApi/products_api.dart';
import 'package:traderscircuit/view_model/ProfileAPI/GetProfileApi.dart';
class ShortTrade extends StatefulWidget {
const ShortTrade({super.key});
@@ -259,71 +261,156 @@ class _ShortTradeState extends State<ShortTrade> {
return Padding(
padding: EdgeInsets.only(top: 20.h, bottom: 5.h),
child: productsController.selectedIndex.value == 0
? cardSwingWidget(
instrumentName: callRecommendationsModel
.data!.activeCalls![index].instrumentKey!,
pdfLink: "",
image: callRecommendationsModel
.data!.activeCalls![index].stockImage!,
text: callRecommendationsModel
.data!.activeCalls![index].stockName!,
amount: '₹ 196.50 - ₹ 197',
targetamount:
'${callRecommendationsModel.data!.activeCalls![index].targetPrice}',
stoploss:
'${callRecommendationsModel.data!.activeCalls![index].stopLoss}',
time:
'${callRecommendationsModel.data!.activeCalls![index].duration}',
action: callRecommendationsModel
.data!.activeCalls![index].actionData!.name!,
)
: productsController.selectedIndex.value == 1
? cardMultibaggerWidget(
instrumentName: callRecommendationsModel
.data!.activeCalls![index].instrumentKey!,
image: callRecommendationsModel
.data!.activeCalls![index].stockImage!,
action: callRecommendationsModel
.data!.activeCalls![index].actionData!.name!,
text: callRecommendationsModel
.data!.activeCalls![index].stockName!,
price:
"${callRecommendationsModel.data!.activeCalls![index].buyPrice}",
date: callRecommendationsModel
.data!.activeCalls![index].createdAt!,
returns:
"${callRecommendationsModel.data!.activeCalls![index].targetPrice}",
stoploss:
"${callRecommendationsModel.data!.activeCalls![index].stopLoss}",
duration: callRecommendationsModel
.data!.activeCalls![index].duration!,
pdfname: "Download Pdf",
pdfLink: callRecommendationsModel
.data!.activeCalls![index].docs!,
)
: cardOptionWidget(
? ProfileObj!.data!.subscriptionData!.productData!
.productName! ==
"Swing Trade"
? cardSwingWidget(
instrumentName: callRecommendationsModel
.data!.activeCalls![index].instrumentKey!,
pdfLink: "",
image: callRecommendationsModel
.data!.activeCalls![index].stockImage!,
action: callRecommendationsModel
.data!.activeCalls![index].actionData!.name!,
text: callRecommendationsModel
.data!.activeCalls![index].stockName!,
optiontype: callRecommendationsModel.data!
.activeCalls![index].optionTypeData!.name!,
price:
"${callRecommendationsModel.data!.activeCalls![index].buyPrice}",
date: callRecommendationsModel
.data!.activeCalls![index].createdAt!,
premium:
"${callRecommendationsModel.data!.activeCalls![index].currentPrice}",
price1:
"${callRecommendationsModel.data!.activeCalls![index].targetPrice}",
amount: '₹ 196.50 - ₹ 197',
targetamount:
'${callRecommendationsModel.data!.activeCalls![index].targetPrice}',
stoploss:
"${callRecommendationsModel.data!.activeCalls![index].stopLoss}",
),
'${callRecommendationsModel.data!.activeCalls![index].stopLoss}',
time:
'${callRecommendationsModel.data!.activeCalls![index].duration}',
action: callRecommendationsModel
.data!.activeCalls![index].actionData!.name!,
)
: Text("Please Subscribe to Swing traxde")
: productsController.selectedIndex.value == 1
? ProfileObj!.data!.subscriptionData!.productData!
.productName! ==
"MultiBagger"
? cardMultibaggerWidget(
instrumentName: callRecommendationsModel
.data!.activeCalls![index].instrumentKey!,
image: callRecommendationsModel
.data!.activeCalls![index].stockImage!,
action: callRecommendationsModel.data!
.activeCalls![index].actionData!.name!,
text: callRecommendationsModel
.data!.activeCalls![index].stockName!,
price:
"${callRecommendationsModel.data!.activeCalls![index].buyPrice}",
date: callRecommendationsModel
.data!.activeCalls![index].createdAt!,
returns:
"${callRecommendationsModel.data!.activeCalls![index].targetPrice}",
stoploss:
"${callRecommendationsModel.data!.activeCalls![index].stopLoss}",
duration: callRecommendationsModel
.data!.activeCalls![index].duration!,
pdfname: "Download Pdf",
pdfLink: callRecommendationsModel
.data!.activeCalls![index].docs!,
)
: Center(
child: commonGlassContainer(
width: double.infinity,
height: 150,
borderradius: 2,
customWidget: Center(
child: Column(
children: [
SizedBox(
height: 20,
),
text18W500(
"Please Subscribe to Multibagger"),
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CommonBtn(
text: "Unlock Now",
onTap: () async {
SharedPreferences prefs =
await SharedPreferences
.getInstance();
Get.to(WebViewSubscription(
token: prefs
.getString('accessToken')
.toString()));
},
),
)
],
),
),
),
)
// Text("Please Subscribe to Multibagger")
: ProfileObj!.data!.subscriptionData!.productData!
.productName! ==
"Options"
? cardOptionWidget(
instrumentName: callRecommendationsModel
.data!.activeCalls![index].instrumentKey!,
pdfLink: "",
image: callRecommendationsModel
.data!.activeCalls![index].stockImage!,
action: callRecommendationsModel.data!
.activeCalls![index].actionData!.name!,
text: callRecommendationsModel
.data!.activeCalls![index].stockName!,
optiontype: callRecommendationsModel.data!
.activeCalls![index].optionTypeData!.name!,
price:
"${callRecommendationsModel.data!.activeCalls![index].buyPrice}",
date: callRecommendationsModel
.data!.activeCalls![index].createdAt!,
premium:
"${callRecommendationsModel.data!.activeCalls![index].currentPrice}",
price1:
"${callRecommendationsModel.data!.activeCalls![index].targetPrice}",
stoploss:
"${callRecommendationsModel.data!.activeCalls![index].stopLoss}",
)
: Center(
child: commonGlassContainer(
width: double.infinity,
height: 150,
borderradius: 2,
customWidget: Center(
child: Column(
children: [
SizedBox(
height: 20,
),
text18W500(
"Please Subscribe to Options"),
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: CommonBtn(
text: "Unlock Now",
onTap: () async {
SharedPreferences prefs =
await SharedPreferences
.getInstance();
Get.to(WebViewSubscription(
token: prefs
.getString('accessToken')
.toString()));
},
),
)
],
),
),
),
),
);
});
}

View File

@@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -14,6 +16,8 @@ import 'package:traderscircuit/resources/routes/route_name.dart';
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
import 'package:traderscircuit/view_model/Login/delete_account_api.dart';
import 'package:traderscircuit/Utils/Dialogs.dart';
import 'package:traderscircuit/view_model/ProfileAPI/GetProfileApi.dart';
import 'package:traderscircuit/view_model/SettingApi/setting_api.dart';
class Settings extends StatefulWidget {
const Settings({super.key});
@@ -23,33 +27,103 @@ class Settings extends StatefulWidget {
}
class _SettingsState extends State<Settings> {
bool isSwitched = false;
bool isSwitched1 = false;
bool isSwitched2 = false;
bool isSwitched3 = false;
late bool isSwitched = false;
late bool isSwitched1 = false;
late bool isSwitched2 = false;
late bool isSwitched3 = false;
void _toggleSwitch(bool value) {
@override
void initState() {
super.initState();
isSwitched = ProfileObj!.data?.alertWhatsAppNotification == 1;
isSwitched1 = ProfileObj!.data?.alertInAppNotification == 1;
isSwitched2 = ProfileObj!.data?.alertPushAppNotification == 1;
isSwitched3 = ProfileObj!.data?.alertSmsAppNotification == 1;
}
Future<void> _verifycheck({
required int alertWhatsAppNotification,
required int alertInAppNotification,
required int alertPushAppNotification,
required int alertSmsAppNotification,
}) async {
Map<String, String> updata = {
"alert_whats_app_notification": alertWhatsAppNotification.toString(),
"alert_in_app_notification": alertInAppNotification.toString(),
"alert_push_app_notification": alertPushAppNotification.toString(),
"alert_sms_app_notification": alertSmsAppNotification.toString(),
};
final resp = await SettingAPI(updata).verifysettingApi();
if (resp.status == ResponseStatus.SUCCESS) {
log(resp.data.toString());
} else if (resp.status == ResponseStatus.PRIVATE) {
String? message = resp.data['message'];
Utils.showToast("$message");
} else if (resp.status == ResponseStatus.ERROR) {
Get.back();
String? message = resp.data['message'];
Utils.showToast("$message");
} else {
Get.back();
String? message = resp.message;
Utils.showToast(message);
}
}
void _toggleSwitch(bool value) async {
setState(() {
isSwitched = value;
ProfileObj?.data?.alertWhatsAppNotification = value ? 1 : 0;
});
await _verifycheck(
alertWhatsAppNotification:
ProfileObj?.data?.alertWhatsAppNotification ?? 0,
alertInAppNotification: ProfileObj?.data?.alertInAppNotification ?? 0,
alertPushAppNotification: ProfileObj?.data?.alertPushAppNotification ?? 0,
alertSmsAppNotification: ProfileObj?.data?.alertSmsAppNotification ?? 0,
);
}
void _toggleSwitch1(bool value1) {
void _toggleSwitch1(bool value1) async {
setState(() {
isSwitched1 = value1;
ProfileObj?.data?.alertInAppNotification = value1 ? 1 : 0;
});
await _verifycheck(
alertWhatsAppNotification:
ProfileObj?.data?.alertWhatsAppNotification ?? 0,
alertInAppNotification: ProfileObj?.data?.alertInAppNotification ?? 0,
alertPushAppNotification: ProfileObj?.data?.alertPushAppNotification ?? 0,
alertSmsAppNotification: ProfileObj?.data?.alertSmsAppNotification ?? 0,
);
}
void _toggleSwitch2(bool value2) {
void _toggleSwitch2(bool value2) async {
setState(() {
isSwitched2 = value2;
ProfileObj?.data?.alertPushAppNotification = value2 ? 1 : 0;
});
await _verifycheck(
alertWhatsAppNotification:
ProfileObj?.data?.alertWhatsAppNotification ?? 0,
alertInAppNotification: ProfileObj?.data?.alertInAppNotification ?? 0,
alertPushAppNotification: ProfileObj?.data?.alertPushAppNotification ?? 0,
alertSmsAppNotification: ProfileObj?.data?.alertSmsAppNotification ?? 0,
);
}
void _toggleSwitch3(bool value3) {
void _toggleSwitch3(bool value3) async {
setState(() {
isSwitched3 = value3;
ProfileObj?.data?.alertSmsAppNotification = value3 ? 1 : 0;
});
await _verifycheck(
alertWhatsAppNotification:
ProfileObj?.data?.alertWhatsAppNotification ?? 0,
alertInAppNotification: ProfileObj?.data?.alertInAppNotification ?? 0,
alertPushAppNotification: ProfileObj?.data?.alertPushAppNotification ?? 0,
alertSmsAppNotification: ProfileObj?.data?.alertSmsAppNotification ?? 0,
);
}
@override

View File

@@ -8,17 +8,10 @@ import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:traderscircuit/Utils/Common/CustomTextFormField.dart';
import 'package:traderscircuit/Utils/Common/commonBotton.dart';
import 'package:traderscircuit/Utils/base_manager.dart';
import 'package:traderscircuit/Utils/text.dart';
import 'package:traderscircuit/Utils/utils.dart';
import 'package:traderscircuit/resources/routes/route_name.dart';
import 'package:traderscircuit/view/login/VerifyOtp.dart';
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
import 'package:traderscircuit/view_model/Login/send_otp_api.dart';
import 'package:traderscircuit/Utils/Dialogs.dart';
import 'package:traderscircuit/view_model/LoginPage/Loginbloc.dart';
import '../../view_model/LoginPage/Loginobserver.dart';
import '../../view_model/SendOtp/sendOtpObserver.dart';
import '../../view_model/SendOtp/sendOtpbloc.dart';

View File

@@ -0,0 +1,27 @@
import 'package:traderscircuit/Utils/api_urls.dart';
import 'package:traderscircuit/Utils/base_manager.dart';
import 'package:traderscircuit/data/network/network_api_services.dart';
class SettingAPI {
SettingAPI(this.data);
var data;
Future<ResponseData<dynamic>> verifysettingApi() async {
final response = await NetworkApiServices().postApi(
// optionalpar: true,
data,
ApiUrls.setting,
);
if (response.status == ResponseStatus.SUCCESS) {
Map<String, dynamic> responseData =
Map<String, dynamic>.from(response.data);
if (responseData['status'] == "success") {
print("token is $response");
} else {
return ResponseData<dynamic>(
responseData['message'], ResponseStatus.FAILED);
}
}
return response;
}
}