diff --git a/lib/Utils/Common/CommonAppBar.dart b/lib/Utils/Common/CommonAppBar.dart index e10faa0..4df8fbd 100644 --- a/lib/Utils/Common/CommonAppBar.dart +++ b/lib/Utils/Common/CommonAppBar.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:traderscircuit/Utils/text.dart'; class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { @override diff --git a/lib/Utils/api_urls.dart b/lib/Utils/api_urls.dart index d7ad28e..c4f6719 100644 --- a/lib/Utils/api_urls.dart +++ b/lib/Utils/api_urls.dart @@ -62,4 +62,13 @@ class ApiUrls { "${base}get-detailed-ticket-data-with-chats/"; static String sendMessage = "${base}send-message-to-admin"; static String updateTicketStatusApi = "${base}update-ticket-status"; + + //Products + static String getListOfProducts = "${base}list-of-products"; + static String getOptionsRecommendations = + "${base}get-options-recommendations"; + static String getSwingTradeRecommendations = + "${base}get-swing-trade-recommendations"; + static String getMultibaggerRecommendations = + "${base}get-multibagger-recommendations"; } diff --git a/lib/controller/products_controller.dart b/lib/controller/products_controller.dart new file mode 100644 index 0000000..3abe3e8 --- /dev/null +++ b/lib/controller/products_controller.dart @@ -0,0 +1,9 @@ +import 'package:get/get.dart'; +import 'package:traderscircuit/model/ProductsModel/call_recommendations_model.dart'; + +class ProductsController extends GetxController { + RxBool isLoaded = true.obs; + CallRecommendationsModel swingTradeModel = CallRecommendationsModel(); + CallRecommendationsModel multibaggerModel = CallRecommendationsModel(); + CallRecommendationsModel optionModel = CallRecommendationsModel(); +} diff --git a/lib/main.dart b/lib/main.dart index 9624b71..f110e5e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:developer'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/material.dart'; @@ -24,6 +25,7 @@ Future main() async { OneSignal.shared.promptUserForPushNotificationPermission(); OneSignal.shared .setSubscriptionObserver((OSSubscriptionStateChanges changes) async { + log(changes.to.userId!.toString()); await prefs.setString('playerId', changes.to.userId!); }); // GlobalVariables globalVariables = GlobalVariables(); diff --git a/lib/model/ProductsModel/call_recommendations_model.dart b/lib/model/ProductsModel/call_recommendations_model.dart new file mode 100644 index 0000000..47c1dd0 --- /dev/null +++ b/lib/model/ProductsModel/call_recommendations_model.dart @@ -0,0 +1,199 @@ +class CallRecommendationsModel { + String? status; + int? statusCode; + String? message; + Data? data; + + CallRecommendationsModel( + {this.status, this.statusCode, this.message, this.data}); + + CallRecommendationsModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + List? activeCalls; + List? exitedCalls; + + Data({this.activeCalls, this.exitedCalls}); + + Data.fromJson(Map json) { + if (json['active_calls'] != null) { + activeCalls = []; + json['active_calls'].forEach((v) { + activeCalls!.add(ActiveCalls.fromJson(v)); + }); + } + if (json['exited_calls'] != null) { + exitedCalls = []; + json['exited_calls'].forEach((v) { + exitedCalls!.add(ActiveCalls.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + if (activeCalls != null) { + data['active_calls'] = activeCalls!.map((v) => v.toJson()).toList(); + } + if (exitedCalls != null) { + data['exited_calls'] = exitedCalls!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ActiveCalls { + int? id; + int? manageProductXid; + int? recommendationActionsXid; + String? stockName; + String? instrumentKey; + String? stockImage; + String? qty; + String? duration; + int? currentPrice; + int? buyPrice; + int? targetPrice; + int? stopLoss; + int? isSendRecommendationNow; + Null? scheduleDateTime; + String? createdAt; + ProductData? productData; + ActionData? actionData; + + ActiveCalls( + {this.id, + this.manageProductXid, + this.recommendationActionsXid, + this.stockName, + this.instrumentKey, + this.stockImage, + this.qty, + this.duration, + this.currentPrice, + this.buyPrice, + this.targetPrice, + this.stopLoss, + this.isSendRecommendationNow, + this.scheduleDateTime, + this.createdAt, + this.productData, + this.actionData}); + + ActiveCalls.fromJson(Map json) { + id = json['id']; + manageProductXid = json['manage_product_xid']; + recommendationActionsXid = json['recommendation_actions_xid']; + stockName = json['stock_name']; + instrumentKey = json['instrument_key']; + stockImage = json['stock_image']; + qty = json['qty']; + duration = json['duration']; + currentPrice = json['current_price']; + buyPrice = json['buy_price']; + targetPrice = json['target_price']; + stopLoss = json['stop_loss']; + isSendRecommendationNow = json['is_send_recommendation_now']; + scheduleDateTime = json['schedule_date_time']; + createdAt = json['created_at']; + productData = json['product_data'] != null + ? ProductData.fromJson(json['product_data']) + : null; + actionData = json['action_data'] != null + ? ActionData.fromJson(json['action_data']) + : null; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['manage_product_xid'] = manageProductXid; + data['recommendation_actions_xid'] = recommendationActionsXid; + data['stock_name'] = stockName; + data['instrument_key'] = instrumentKey; + data['stock_image'] = stockImage; + data['qty'] = qty; + data['duration'] = duration; + data['current_price'] = currentPrice; + data['buy_price'] = buyPrice; + data['target_price'] = targetPrice; + data['stop_loss'] = stopLoss; + data['is_send_recommendation_now'] = isSendRecommendationNow; + data['schedule_date_time'] = scheduleDateTime; + data['created_at'] = createdAt; + if (productData != null) { + data['product_data'] = productData!.toJson(); + } + if (actionData != null) { + data['action_data'] = actionData!.toJson(); + } + return data; + } +} + +class ProductData { + int? id; + String? productName; + int? isActive; + String? createdAt; + + ProductData({this.id, this.productName, this.isActive, this.createdAt}); + + ProductData.fromJson(Map json) { + id = json['id']; + productName = json['product_name']; + isActive = json['is_active']; + createdAt = json['created_at']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['product_name'] = productName; + data['is_active'] = isActive; + data['created_at'] = createdAt; + return data; + } +} + +class ActionData { + int? id; + String? name; + int? isActive; + Null? createdAt; + + ActionData({this.id, this.name, this.isActive, this.createdAt}); + + ActionData.fromJson(Map json) { + id = json['id']; + name = json['name']; + isActive = json['is_active']; + createdAt = json['created_at']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['name'] = name; + data['is_active'] = isActive; + data['created_at'] = createdAt; + return data; + } +} diff --git a/lib/model/ProductsModel/list_of_products_model.dart b/lib/model/ProductsModel/list_of_products_model.dart new file mode 100644 index 0000000..bf69b9c --- /dev/null +++ b/lib/model/ProductsModel/list_of_products_model.dart @@ -0,0 +1,140 @@ +class ListOfProductsModel { + String? status; + int? statusCode; + String? message; + List? data; + + ListOfProductsModel({this.status, this.statusCode, this.message, this.data}); + + ListOfProductsModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? id; + String? title; + List? productsData; + + Data({this.id, this.title, this.productsData}); + + Data.fromJson(Map json) { + id = json['id']; + title = json['title']; + if (json['products_data'] != null) { + productsData = []; + json['products_data'].forEach((v) { + productsData!.add(ProductsData.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['title'] = title; + + if (productsData != null) { + data['products_data'] = productsData!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ProductsData { + int? id; + int? productTypeXid; + int? productTierXid; + String? productName; + String? productDescription; + String? productPrice; + String? productImage; + int? isActive; + String? createdAt; + ProductTier? productTier; + + ProductsData( + {this.id, + this.productTypeXid, + this.productTierXid, + this.productName, + this.productDescription, + this.productPrice, + this.productImage, + this.isActive, + this.createdAt, + this.productTier}); + + ProductsData.fromJson(Map json) { + id = json['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']; + isActive = json['is_active']; + createdAt = json['created_at']; + productTier = json['product_tier'] != null + ? ProductTier.fromJson(json['product_tier']) + : null; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['product_type_xid'] = productTypeXid; + data['product_tier_xid'] = productTierXid; + data['product_name'] = productName; + data['product_description'] = productDescription; + data['product_price'] = productPrice; + data['product_image'] = productImage; + data['is_active'] = isActive; + data['created_at'] = createdAt; + if (productTier != null) { + data['product_tier'] = productTier!.toJson(); + } + return data; + } +} + +class ProductTier { + int? id; + String? name; + String? createdAt; + + ProductTier({this.id, this.name, this.createdAt}); + + ProductTier.fromJson(Map json) { + id = json['id']; + name = json['name']; + createdAt = json['created_at']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['name'] = name; + data['created_at'] = createdAt; + return data; + } +} diff --git a/lib/view/MainScreen/HomeScreen.dart b/lib/view/MainScreen/HomeScreen.dart index af7d213..59ded30 100644 --- a/lib/view/MainScreen/HomeScreen.dart +++ b/lib/view/MainScreen/HomeScreen.dart @@ -7,7 +7,6 @@ import 'package:get/get.dart'; import 'package:glassmorphism/glassmorphism.dart'; import 'package:traderscircuit/Utils/Common/CommonBottomNavigation.dart'; import 'package:traderscircuit/Utils/Common/CommonTabBar.dart'; -import 'package:traderscircuit/Utils/Common/MainController.dart'; import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart'; import 'package:traderscircuit/Utils/Common/sized_box.dart'; import 'package:traderscircuit/Utils/text.dart'; @@ -17,6 +16,8 @@ import 'package:traderscircuit/view/Sidemenu/ContentByte/PlayerWidget.dart'; import 'package:traderscircuit/view/Sidemenu/Sidemenu.dart'; import 'package:traderscircuit/view/onBoarding/splashScreen1.dart'; +import '../../view_model/ProfileAPI/GetProfileApi.dart'; + class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @@ -26,6 +27,16 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { GlobalKey _scaffoldKey1 = GlobalKey(); + RxString userName = "User".obs; + + @override + void initState() { + GetProfile().GetProfileAPI().then((value) { + userName.value = ProfileObj!.data!.userName ?? "User"; + }); + super.initState(); + } + @override Widget build(BuildContext context) { return WillPopScope( @@ -37,7 +48,7 @@ class _HomeScreenState extends State { drawerEnableOpenDragGesture: false, key: _scaffoldKey1, backgroundColor: Colors.black, - drawer: Container(child: SideMenu()), + drawer: Container(child: const SideMenu()), extendBody: true, appBar: AppBar( scrolledUnderElevation: 0.0, @@ -70,22 +81,25 @@ class _HomeScreenState extends State { ), body: Stack( children: [ - CommonBlurLeft(), - CommonBlurRight(), + const CommonBlurLeft(), + const CommonBlurRight(), Stack(children: [ Padding( - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: + const EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: ListView( - physics: BouncingScrollPhysics(), + physics: const BouncingScrollPhysics(), children: [ sizedBoxHeight(20.h), - Text( - "Welcome Afrid", - style: TextStyle( - color: Colors.white, - fontSize: 24.sp, - fontFamily: 'hiragino', - fontWeight: FontWeight.w500), + Obx( + () => Text( + "Welcome $userName", + style: TextStyle( + color: Colors.white, + fontSize: 24.sp, + fontFamily: 'hiragino', + fontWeight: FontWeight.w500), + ), ), sizedBoxHeight(25.h), SingleChildScrollView( @@ -110,7 +124,7 @@ class _HomeScreenState extends State { Container( width: double.infinity, height: 1.h, - color: Color(0xFF3A3A3A), + color: const Color(0xFF3A3A3A), ), sizedBoxHeight(30.h), text22W500('View our products'), @@ -147,7 +161,7 @@ class _HomeScreenState extends State { Container( width: double.infinity, height: 1.h, - color: Color(0xFF3A3A3A), + color: const Color(0xFF3A3A3A), ), sizedBoxHeight(25.h), Row( @@ -163,10 +177,10 @@ class _HomeScreenState extends State { height: 35.h, width: 105.w, decoration: BoxDecoration( - color: Color(0xFF3A3A3A).withOpacity(0.6), + color: const Color(0xFF3A3A3A).withOpacity(0.6), borderRadius: BorderRadius.circular(5.r), border: Border.all( - color: Color(0xFF3A3A3A), + color: const Color(0xFF3A3A3A), )), child: Center(child: text16W500('View More')), ), @@ -261,15 +275,15 @@ Widget ActiveCallsTab() { width: 240.w, child: text16W400_DADADA('The Beauty and Power of Video')), // sizedBoxWidth(10.w), - Spacer(), + const Spacer(), Container( height: 35.h, width: 105.w, decoration: BoxDecoration( - color: Color(0xFF3A3A3A).withOpacity(0.6), + color: const Color(0xFF3A3A3A).withOpacity(0.6), borderRadius: BorderRadius.circular(5.r), border: Border.all( - color: Color(0xFF3A3A3A), + color: const Color(0xFF3A3A3A), ), ), child: Center( @@ -294,7 +308,7 @@ Widget ActiveCallsTab() { children: [ InkWell( onTap: () { - Get.to(() => PlayerWidget(), arguments: { + Get.to(() => const PlayerWidget(), arguments: { "video_url": "", }); }, @@ -303,7 +317,7 @@ Widget ActiveCallsTab() { width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.r), - image: DecorationImage( + image: const DecorationImage( image: AssetImage( 'assets/images/png/Rectangle 17934.png'))), child: Center( @@ -321,8 +335,8 @@ Widget ActiveCallsTab() { children: [ CircleAvatar( radius: 23.r, - backgroundImage: - AssetImage('assets/images/png/Ellipse 1494.png'), + backgroundImage: const AssetImage( + 'assets/images/png/Ellipse 1494.png'), ), sizedBoxWidth(10.w), Expanded( @@ -406,7 +420,7 @@ Widget cardcallWidget( blur: 10, alignment: Alignment.center, border: 0.9, - linearGradient: LinearGradient( + linearGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -414,7 +428,7 @@ Widget cardcallWidget( Color(0xFF3A3A3A), ], ), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -429,13 +443,13 @@ Widget cardcallWidget( ), sizedBoxWidth(15.w), text18W600(text), - Spacer(), + const Spacer(), Container( width: 62.w, height: 25.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4.r), - color: Color(0xFFFFAD31), + color: const Color(0xFFFFAD31), ), child: Center(child: text16W400_1B1B1B('Hold')), ) @@ -445,7 +459,7 @@ Widget cardcallWidget( Container( width: double.infinity, height: 1.h, - color: Color(0xFF3A3A3A), + color: const Color(0xFF3A3A3A), ), Padding( padding: const EdgeInsets.all(20), @@ -460,7 +474,7 @@ Widget cardcallWidget( ], ), // sizedBoxWidth(50.w), - Spacer(), + const Spacer(), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -500,13 +514,13 @@ Widget ProductWidget({required String text, required String subtext}) { end: Alignment.bottomRight, colors: [ Colors.white.withOpacity(0.1), - Color(0xFFFFFFFF).withOpacity(0.05), + const Color(0xFFFFFFFF).withOpacity(0.05), ], stops: [ 0.1, 1, ]), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -545,13 +559,13 @@ Widget commoncontainer( end: Alignment.bottomRight, colors: [ Colors.white.withOpacity(0.1), - Color(0xFFFFFFFF).withOpacity(0.05), + const Color(0xFFFFFFFF).withOpacity(0.05), ], stops: [ 0.1, 1, ]), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ diff --git a/lib/view/MainScreen/ShortTrade.dart b/lib/view/MainScreen/ShortTrade.dart index a8c60b3..c5a530c 100644 --- a/lib/view/MainScreen/ShortTrade.dart +++ b/lib/view/MainScreen/ShortTrade.dart @@ -1,21 +1,22 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; 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:traderscircuit/Utils/Common/CommonAppBar.dart'; import 'package:traderscircuit/Utils/Common/CommonBottomNavigation.dart'; import 'package:traderscircuit/Utils/Common/CommonTabBar.dart'; import 'package:traderscircuit/Utils/Common/commonBotton.dart'; import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart'; import 'package:traderscircuit/Utils/Common/sized_box.dart'; import 'package:traderscircuit/Utils/text.dart'; -import 'package:traderscircuit/resources/routes/route_name.dart'; +import 'package:traderscircuit/controller/products_controller.dart'; +import 'package:traderscircuit/model/ProductsModel/call_recommendations_model.dart'; import 'package:traderscircuit/view/MainScreen/MainScreen.dart'; -import 'package:traderscircuit/view/Sidemenu/ContentByte/PlayerWidget.dart'; import 'package:traderscircuit/view/Sidemenu/Sidemenu.dart'; import 'package:traderscircuit/view/onBoarding/splashScreen1.dart'; +import 'package:traderscircuit/view_model/ProductsApi/products_api.dart'; class ShortTrade extends StatefulWidget { const ShortTrade({super.key}); @@ -28,6 +29,27 @@ class _ShortTradeState extends State { GlobalKey _scaffoldKey1 = GlobalKey(); List containerTexts = ["Swing Trade", "Multibagger", "Options"]; final selectedIndex = 0.obs; + ProductsController productsController = Get.put(ProductsController()); + + @override + void initState() { + productsController.isLoaded.value = true; + ProductsApi().getSwingTradeRecommendationsApi().then((value) { + productsController.swingTradeModel = + CallRecommendationsModel.fromJson(value.data); + ProductsApi().getMultibaggerRecommendationsApi().then((value) { + productsController.multibaggerModel = + CallRecommendationsModel.fromJson(value.data); + ProductsApi().getOptionsRecommendationsApi().then((value) { + productsController.optionModel = + CallRecommendationsModel.fromJson(value.data); + productsController.isLoaded.value = false; + }); + }); + }); + super.initState(); + } + @override Widget build(BuildContext context) { return WillPopScope( @@ -38,7 +60,7 @@ class _ShortTradeState extends State { child: Scaffold( key: _scaffoldKey1, backgroundColor: Colors.black, drawerEnableOpenDragGesture: false, - drawer: Container(child: SideMenu()), + drawer: const SideMenu(), extendBody: true, appBar: AppBar( scrolledUnderElevation: 0.0, @@ -83,63 +105,88 @@ class _ShortTradeState extends State { // // ), // ), // ), - body: Stack( - children: [ - CommonBlurLeft(), - CommonBlurRight(), - Stack(children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: ListView( - physics: NeverScrollableScrollPhysics(), - children: [ - sizedBoxHeight(15.h), - SizedBox( - height: 60, - width: double.infinity, - // color: Colors.amber, - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.horizontal, - itemCount: containerTexts.length, - itemBuilder: (context, index) { - return GestureDetector( - onTap: () { - selectedIndex.value = index; - }, - child: Row( + body: Obx( + () => Stack( + children: [ + const CommonBlurLeft(), + const CommonBlurRight(), + Stack(children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, vertical: 16), + child: ListView( + physics: const NeverScrollableScrollPhysics(), + children: [ + sizedBoxHeight(15.h), + SizedBox( + height: 60, + width: double.infinity, + // color: Colors.amber, + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + itemCount: containerTexts.length, + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + selectedIndex.value = index; + }, + child: Row( + children: [ + topContainer( + containerTexts[index], index), + sizedBoxWidth(10.w) + ], + ), + ); + }), + ), + sizedBoxHeight(20.h), + productsController.isLoaded.value + ? const Center( + child: CircularProgressIndicator( + color: Colors.redAccent, + ), + ) + : DefaultTabController( + length: 2, + // initialIndex: selectedIndex.value, + child: Column( children: [ - topContainer( - containerTexts[index], index), - sizedBoxWidth(10.w) + MyTabBar(), + SizedBox( + height: 700.h, + child: TabBarView( + children: [ + ActiveCallsTab( + selectedIndex.value == 0 + ? productsController + .swingTradeModel + : selectedIndex.value == 1 + ? productsController + .multibaggerModel + : productsController + .optionModel), + ExitedCallsTab( + selectedIndex.value == 0 + ? productsController + .swingTradeModel + : selectedIndex.value == 1 + ? productsController + .multibaggerModel + : productsController + .optionModel), + ], + ), + ), ], ), - ); - }), - ), - sizedBoxHeight(20.h), - DefaultTabController( - length: 2, - // initialIndex: selectedIndex.value, - child: Column( - children: [ - MyTabBar(), - SizedBox( - height: 700.h, - child: TabBarView( - children: [ - ActiveCallsTab(), - ExitedCallsTab(), - ], ), - ), - ], - ), - ), - sizedBoxHeight(20.h), - ])) - ]) - ], + sizedBoxHeight(20.h), + ])) + ]) + ], + ), ), bottomNavigationBar: bottomnavigationbar(mainController), ), @@ -184,127 +231,55 @@ class _ShortTradeState extends State { return exitApp ?? false; } - Widget ActiveCallsTab() { - return Obx(() { - WidgetsBinding.instance.addPostFrameCallback((_) { - if (selectedIndex == 1 || selectedIndex == 2) _unlockbottomsheet(); - }); - return selectedIndex == 0 - ? SingleChildScrollView( - physics: AlwaysScrollableScrollPhysics(), - child: Padding( - padding: EdgeInsets.only(top: 20.h, bottom: 210.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - cardSwingWidget( - text: 'Indiabulls Housing Finance Ltd', + Widget ActiveCallsTab(CallRecommendationsModel callRecommendationsModel) { + return callRecommendationsModel.data!.activeCalls!.isEmpty + ? Center( + child: Column( + children: [ + const Gap(200), + text22W600("No Data Available !"), + ], + )) + : ListView.builder( + itemCount: callRecommendationsModel.data!.activeCalls!.length, + itemBuilder: (ctx, index) { + return Padding( + padding: EdgeInsets.only(top: 20.h, bottom: 5.h), + child: selectedIndex.value == 0 + ? cardSwingWidget( + image: callRecommendationsModel + .data!.activeCalls![index].stockImage!, + text: callRecommendationsModel + .data!.activeCalls![index].stockName!, amount: '₹ 196.50 - ₹ 197', - targetamount: '₹ 204', - stoploss: '₹ 190', - time: '4-5 Days'), - sizedBoxHeight(25.h), - text22W600('Content Bytes'), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - width: 240.w, - child: text16W400_DADADA( - 'The Beauty and Power of Video')), - Spacer(), - Container( - height: 35.h, - width: 105.w, - decoration: BoxDecoration( - color: Color(0xFF3A3A3A).withOpacity(0.6), - borderRadius: BorderRadius.circular(5.r), - border: Border.all( - color: Color(0xFF3A3A3A), - )), - child: Center( - child: InkWell( - onTap: () { - Get.toNamed(RouteName.contentbytes); - }, - child: text16W500('View More'), - ), - ), - ), - ], - ), - sizedBoxHeight(20.h), - commonGlassContainer( - borderradius: 8, - width: double.infinity, - height: 330.h, - customWidget: Padding( - padding: EdgeInsets.symmetric( - vertical: 10.h, horizontal: 10.w), - child: Column( - children: [ - InkWell( - onTap: () { - Get.to(() => PlayerWidget(), arguments: { - "video_url": "", - }); - }, - child: Container( - height: 200.h, - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.r), - image: DecorationImage( - image: AssetImage( - 'assets/images/png/Rectangle 17934.png'))), - child: Center( - child: SvgPicture.asset( - 'assets/images/svg/gridicons_play.svg', - height: 56.h, - width: 56.w, - ), - ), - ), - ), - sizedBoxHeight(20.h), - Row( - children: [ - CircleAvatar( - radius: 23.r, - backgroundImage: AssetImage( - 'assets/images/png/Ellipse 1494.png'), - ), - sizedBoxWidth(10.w), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - text18W500('Week of 21st February 2024'), - // sizedBoxHeight(10.h), - text12W400_979797( - '20k views . 2 days ago'), - ], - ), - ) - ], - ) - ], - ), - ), - ), - ], - ), - ), - ) - : selectedIndex == 1 - ? Column( - children: [], - ) - : Column( - children: [], - ); - }); + 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!, + ) + : selectedIndex.value == 1 + ? cardMultibaggerWidget( + text: callRecommendationsModel + .data!.activeCalls![index].stockName!, + price: + "₹ ${callRecommendationsModel.data!.activeCalls![index].buyPrice}", + date: callRecommendationsModel + .data!.activeCalls![index].createdAt!, + returns: + "₹ ${callRecommendationsModel.data!.activeCalls![index].stopLoss}", + stoploss: + "₹ ${callRecommendationsModel.data!.activeCalls![index].stopLoss}", + duration: callRecommendationsModel + .data!.activeCalls![index].duration!, + pdfname: "Download Pdf", + ) + : SizedBox(), + ); + }); } void _unlockbottomsheet() { @@ -331,7 +306,7 @@ class _ShortTradeState extends State { onTap: () {}, ), - SizedBox( + const SizedBox( height: 100, ) ], @@ -343,7 +318,7 @@ class _ShortTradeState extends State { ); } - Widget ExitedCallsTab() { + Widget ExitedCallsTab(CallRecommendationsModel callRecommendationsModel) { List> cardSwing = [ { 'text': 'Indiabulls Housing Finance Ltd', @@ -436,22 +411,38 @@ class _ShortTradeState extends State { children: [ sizedBoxHeight(20.h), Obx(() { - return selectedIndex == 0 - ? Column( - children: List.generate(cardSwing.length, (index) { - return Column( + return selectedIndex.value == 0 + ? callRecommendationsModel.data!.exitedCalls!.isEmpty + ? Center( + child: Column( children: [ - cardSwingWidget( - text: cardSwing[index]['text']!, - amount: cardSwing[index]['amount']!, - targetamount: cardSwing[index]['targetamount']!, - stoploss: cardSwing[index]['stoploss']!, - time: cardSwing[index]['time']!), - sizedBoxHeight(20.h) + const Gap(200), + text22W600("No Data Available !"), ], - ); - }), - ) + )) + : ListView.builder( + itemCount: + callRecommendationsModel.data!.exitedCalls!.length, + itemBuilder: (ctx, index) { + return Padding( + padding: EdgeInsets.only(top: 20.h, bottom: 5.h), + child: cardSwingWidget( + image: callRecommendationsModel + .data!.exitedCalls![index].stockImage!, + text: callRecommendationsModel + .data!.exitedCalls![index].stockName!, + amount: '₹ 196.50 - ₹ 197', + targetamount: + '₹ ${callRecommendationsModel.data!.exitedCalls![index].targetPrice}', + stoploss: + '₹ ${callRecommendationsModel.data!.exitedCalls![index].stopLoss}', + time: + '${callRecommendationsModel.data!.exitedCalls![index].duration}', + action: callRecommendationsModel + .data!.exitedCalls![index].actionData!.name!, + ), + ); + }) : selectedIndex == 1 ? Column( children: @@ -526,7 +517,7 @@ class _ShortTradeState extends State { blur: 10, alignment: Alignment.center, border: 0.9, - linearGradient: LinearGradient( + linearGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -534,7 +525,7 @@ class _ShortTradeState extends State { Color(0xFF3A3A3A), ], ), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -552,13 +543,13 @@ class _ShortTradeState extends State { ), sizedBoxWidth(15.w), SizedBox(width: 200.w, child: text18W600(text)), - Spacer(), + const Spacer(), Container( width: 62.w, height: 25.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4.r), - color: Color(0xFFFFAD31), + color: const Color(0xFFFFAD31), ), child: Center(child: text14W600_1B1B1B('Hold')), ) @@ -568,7 +559,7 @@ class _ShortTradeState extends State { Container( width: double.infinity, height: 1.h, - color: Color(0xFF3A3A3A), + color: const Color(0xFF3A3A3A), ), Padding( padding: const EdgeInsets.all(18), @@ -684,7 +675,7 @@ class _ShortTradeState extends State { blur: 10, alignment: Alignment.center, border: 0.9, - linearGradient: LinearGradient( + linearGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -692,7 +683,7 @@ class _ShortTradeState extends State { Color(0xFF3A3A3A), ], ), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -710,13 +701,13 @@ class _ShortTradeState extends State { ), sizedBoxWidth(15.w), SizedBox(width: 200.w, child: text18W600(text)), - Spacer(), + const Spacer(), Container( width: 62.w, height: 25.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4.r), - color: Color(0xFFFFAD31), + color: const Color(0xFFFFAD31), ), child: Center(child: text14W600_1B1B1B('Hold')), ) @@ -726,7 +717,7 @@ class _ShortTradeState extends State { Container( width: double.infinity, height: 1.h, - color: Color(0xFF3A3A3A), + color: const Color(0xFF3A3A3A), ), Padding( padding: const EdgeInsets.all(18), @@ -819,11 +810,13 @@ class _ShortTradeState extends State { } Widget cardSwingWidget({ + required String image, required String text, required String amount, required String targetamount, required String stoploss, required String time, + required String action, }) { return commonGlassContainer( width: double.infinity, @@ -842,7 +835,7 @@ class _ShortTradeState extends State { blur: 10, alignment: Alignment.center, border: 0.9, - linearGradient: LinearGradient( + linearGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -850,7 +843,7 @@ class _ShortTradeState extends State { Color(0xFF3A3A3A), ], ), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -859,20 +852,22 @@ class _ShortTradeState extends State { ], ), child: Center( - child: Image.asset('assets/images/png/Teal.png'), + child: CachedNetworkImage(imageUrl: image), ), ), sizedBoxWidth(15.w), SizedBox(width: 200.w, child: text18W600(text)), - Spacer(), + const Spacer(), Container( width: 62.w, height: 25.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4.r), - color: Color(0xFFFFAD31), + color: action == "Buy" + ? const Color(0xFF00FF19) + : const Color(0xFFFFAD31), ), - child: Center(child: text14W600_1B1B1B('Hold')), + child: Center(child: text14W600_1B1B1B(action)), ) ], ), @@ -880,7 +875,7 @@ class _ShortTradeState extends State { Container( width: double.infinity, height: 1.h, - color: Color(0xFF3A3A3A), + color: const Color(0xFF3A3A3A), ), Padding( padding: const EdgeInsets.all(20), @@ -945,7 +940,7 @@ class _ShortTradeState extends State { width: 126.w, decoration: BoxDecoration( borderRadius: BorderRadius.circular(5), - color: Color(0Xff6C0000), + color: const Color(0Xff6C0000), ), child: Center(child: text16W500(text)), ) diff --git a/lib/view/Sidemenu/Sidemenu.dart b/lib/view/Sidemenu/Sidemenu.dart index bf91a5c..fd140ad 100644 --- a/lib/view/Sidemenu/Sidemenu.dart +++ b/lib/view/Sidemenu/Sidemenu.dart @@ -21,7 +21,6 @@ class _SideMenuState extends State { @override void initState() { // TODO: implement initState - GetProfile().GetProfileAPI(); super.initState(); } @@ -132,9 +131,7 @@ class _SideMenuState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - text18W400( - //ProfileObj!.data!.userName ?? - ""), + text18W400(ProfileObj!.data!.userName ?? ""), sizedBoxHeight(4.h), text18W400('My Profile'), ], diff --git a/lib/view/Sidemenu/contactUs/contact_us_details.dart b/lib/view/Sidemenu/contactUs/contact_us_details.dart index 03b25b7..71b22fe 100644 --- a/lib/view/Sidemenu/contactUs/contact_us_details.dart +++ b/lib/view/Sidemenu/contactUs/contact_us_details.dart @@ -65,10 +65,29 @@ class _ContactUsDetailsScreenState extends State { child: Form( key: queriesForm, child: Scaffold( - appBar: CommonAppbar( - height: 75, - titleTxt: "", - customActionWidget: text16W400(""), + appBar: AppBar( + scrolledUnderElevation: 0.0, + backgroundColor: Colors.black, + elevation: 0, + leadingWidth: 56.w, + leading: Padding( + padding: EdgeInsets.only(left: 16.w, top: 20.h), + child: GestureDetector( + onTap: () { + contactUsController.isTicketClosed + ? Get.back(result: true) + : Get.back(); + }, + child: Padding( + padding: EdgeInsets.only(left: 8.w), + child: Icon( + Icons.arrow_back_ios, + color: Colors.white, + size: 25.r, + ), + ), + ), + ), ), backgroundColor: Colors.black, extendBody: true, diff --git a/lib/view/Sidemenu/contactUs/contact_us_main.dart b/lib/view/Sidemenu/contactUs/contact_us_main.dart index 80066f9..365c3a7 100644 --- a/lib/view/Sidemenu/contactUs/contact_us_main.dart +++ b/lib/view/Sidemenu/contactUs/contact_us_main.dart @@ -1,3 +1,216 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:gap/gap.dart'; +import 'package:get/get.dart'; +import 'package:traderscircuit/controller/contact_us_controller.dart'; +import 'package:traderscircuit/model/ContactUsModel/contact_us_cat_model.dart'; +import 'package:traderscircuit/model/ContactUsModel/contact_us_model.dart'; +import 'package:traderscircuit/resources/routes/route_name.dart'; +import 'package:traderscircuit/view_model/ContactUsApi/contact_us_api.dart'; +import '../../../Utils/Common/CommonAppbar.dart'; +import '../../../Utils/Common/commonBotton.dart'; +import '../../../Utils/text.dart'; +import '../../../view_model/ProfileAPI/GetProfileApi.dart'; +import '../../onBoarding/splashScreen1.dart'; +import 'create_ticket_bottom_sheet.dart'; + +class ContactUsMainScreen extends StatefulWidget { + const ContactUsMainScreen({super.key}); + + @override + State createState() => _ContactUsMainScreenState(); +} + +class _ContactUsMainScreenState extends State { + ContactUsController contactUsController = Get.put(ContactUsController()); + + RxBool isEmpty = false.obs; + @override + void initState() { + contactUsController.isLoading.value == true; + ContactUsApi().getContactUsCategoriesData().then((value) { + contactUsController.contactCatModel = + ContactUsCatModel.fromJson(value.data); + + ContactUsApi().getContactUsData().then((value) { + Map responseData = + Map.from(value.data); + if (responseData["message"] == "Data not found.") { + isEmpty.value = true; + } else { + contactUsController.allC.value = 0; + contactUsController.openC.value = 0; + contactUsController.closeC.value = 0; + contactUsController.resolvedC.value = 0; + + contactUsController.contactModel = + ContactUsModel.fromJson(value.data); + for (var a in contactUsController.contactModel.data!) { + if (a.status == 1) { + contactUsController.openC.value += 1; + contactUsController.allC.value += 1; + } else if (a.status == 2) { + contactUsController.closeC.value += 1; + contactUsController.allC.value += 1; + } else if (a.status == 3) { + contactUsController.resolvedC.value += 1; + contactUsController.allC.value += 1; + } + } + } + contactUsController.isLoading.value = false; + }); + }); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Obx(() => DefaultTabController( + length: 4, + child: Scaffold( + appBar: CommonAppbar( + height: 75, + titleTxt: "", + customActionWidget: text16W400(""), + ), + backgroundColor: Colors.black, + extendBody: true, + bottomNavigationBar: Padding( + padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 40), + child: SizedBox( + width: Get.width, + child: kycBtn( + text: "Create Ticket", + onTap: () { + contactUsController.attachmentFileList.clear(); + contactUsController.attachmentPathNameList.clear(); + CreateTicketBottomSheet().bottomSheet(context); + }, + bgClr: const Color(0xFF6C0000), + borderClr: const Color(0xFF990000), + ), + ), + ), + body: Stack( + children: [ + const CommonBlurLeft(), + const CommonBlurRight(), + Stack(children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, vertical: 16), + child: contactUsController.isLoading.value + ? const Center( + child: CircularProgressIndicator( + color: Colors.redAccent, + )) + : isEmpty.value + ? Center(child: text18W800("No Data Available")) + : ListView( + physics: const NeverScrollableScrollPhysics(), + children: [ + text25W600("Contact Us"), + const Gap(20), + text16W400( + "Hi ${ProfileObj!.data!.userName}"), + text16W400("We are here to help you"), + const Gap(12), + TabBar( + tabAlignment: TabAlignment.start, + labelStyle: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w400, + fontFamily: "hiragino", + ), + isScrollable: true, + labelColor: Colors.white, + unselectedLabelColor: + const Color(0xFF464646), + indicatorColor: const Color(0xFF6C0000), + indicatorSize: TabBarIndicatorSize.tab, + unselectedLabelStyle: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w500, + fontFamily: "hiragino", + ), + tabs: [ + Tab( + text: + "All Tickets (${contactUsController.allC.value})"), + Tab( + text: + "Open Tickets (${contactUsController.openC.value})"), + Tab( + text: + "Closed (${contactUsController.closeC.value})"), + Tab( + text: + "Resolved (${contactUsController.resolvedC.value})"), + ], + ), + SizedBox( + height: 0.5.sh, + child: TabBarView(children: [ + ListView.builder( + itemCount: contactUsController + .contactModel.data!.length, + itemBuilder: (ctx, index) { + return ticketCardWidget( + index, "ALL"); + }), + ListView.builder( + itemCount: contactUsController + .contactModel.data!.length, + itemBuilder: (ctx, index) { + return contactUsController + .contactModel + .data![index] + .status == + 1 + ? ticketCardWidget( + index, "OPEN") + : const SizedBox(); + }), + ListView.builder( + itemCount: contactUsController + .contactModel.data!.length, + itemBuilder: (ctx, index) { + return contactUsController + .contactModel + .data![index] + .status == + 2 + ? ticketCardWidget( + index, "CLOSED") + : const SizedBox(); + }), + ListView.builder( + itemCount: contactUsController + .contactModel.data!.length, + itemBuilder: (ctx, index) { + return contactUsController + .contactModel + .data![index] + .status == + 3 + ? ticketCardWidget( + index, "RESOLVED") + : const SizedBox(); + }), + ]), + ) + ], + )), + ]), + ], + ), + ), + )); + } +} + Widget ticketCardWidget(index, type) { ContactUsController contactUsController = Get.put(ContactUsController()); return InkWell( diff --git a/lib/view/login/VerifyOtp.dart b/lib/view/login/VerifyOtp.dart index 978cbe5..4c918d6 100644 --- a/lib/view/login/VerifyOtp.dart +++ b/lib/view/login/VerifyOtp.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -44,6 +46,7 @@ class _VerifyOTPState extends State { if (isValid!) { SharedPreferences prefs = await SharedPreferences.getInstance(); Utils.loader(); + // print("PLAYER ID ==> ${prefs.getString("playerId")}"); Map updata = { "mobile_number": phonenumber.toString(), "otp": pincode.text, @@ -51,6 +54,7 @@ class _VerifyOTPState extends State { }; final resp = await VerifyNumberAPI(updata).verifynumberApi(); if (resp.status == ResponseStatus.SUCCESS) { + log(resp.data.toString()); Get.back(); isVendorExist = resp.data["data"]["vendor_account_exist"]; isProfileUpdated = resp.data["data"]["user_data"]["profile_updated"]; @@ -101,7 +105,7 @@ class _VerifyOTPState extends State { } else { Get.back(); String? message = resp.message; - Utils.showToast("$message"); + Utils.showToast(message); } } } @@ -109,21 +113,22 @@ class _VerifyOTPState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: CommonAppbar(titleTxt: "Verify OTP"), + appBar: const CommonAppbar(titleTxt: "Verify OTP"), backgroundColor: Colors.black, extendBody: true, body: Stack( children: [ - CommonBlurLeft(), - CommonBlurRight(), + const CommonBlurLeft(), + const CommonBlurRight(), Stack( children: [ Padding( - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: + const EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: Form( key: _otpform, child: ListView( - physics: BouncingScrollPhysics(), + physics: const BouncingScrollPhysics(), // mainAxisAlignment: MainAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -165,7 +170,7 @@ class _VerifyOTPState extends State { fieldHeight: 60.h, fieldWidth: 60.w, ), - animationDuration: Duration(milliseconds: 300), + animationDuration: const Duration(milliseconds: 300), enableActiveFill: true, controller: pincode, onCompleted: (v) { diff --git a/lib/view/onBoarding/splashScreen.dart b/lib/view/onBoarding/splashScreen.dart index 0dd2054..4260a28 100644 --- a/lib/view/onBoarding/splashScreen.dart +++ b/lib/view/onBoarding/splashScreen.dart @@ -6,6 +6,7 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:onesignal_flutter/onesignal_flutter.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:traderscircuit/resources/routes/route_name.dart'; @@ -46,7 +47,10 @@ class _SplashScreenState extends State void initState() { super.initState(); checkInternet(); - + OneSignal.shared + .setSubscriptionObserver((OSSubscriptionStateChanges changes) async { + print(changes.to.userId!.toString()); + }); Future.delayed(Duration(seconds: 2), () async { if (_connectionStatus == ConnectivityResult.none) { var result = await Get.to(NoInternet()); diff --git a/lib/view_model/ProductsApi/products_api.dart b/lib/view_model/ProductsApi/products_api.dart new file mode 100644 index 0000000..f363892 --- /dev/null +++ b/lib/view_model/ProductsApi/products_api.dart @@ -0,0 +1,75 @@ +import 'dart:developer'; + +import 'package:traderscircuit/Utils/api_urls.dart'; +import 'package:traderscircuit/Utils/base_manager.dart'; +import 'package:traderscircuit/data/network/network_api_services.dart'; + +class ProductsApi { + Future> getListOfProducts() async { + final response = await NetworkApiServices() + .getApi(ApiUrls.getListOfProducts, isAuth: true); + log(response.data.toString()); + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + return response; + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } + + Future> getOptionsRecommendationsApi() async { + final response = await NetworkApiServices() + .getApi(ApiUrls.getOptionsRecommendations, isAuth: true); + // log(response.data.toString()); + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + return response; + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } + + Future> getSwingTradeRecommendationsApi() async { + final response = await NetworkApiServices() + .getApi(ApiUrls.getSwingTradeRecommendations, isAuth: true); + // log(response.data.toString()); + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + return response; + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } + + Future> getMultibaggerRecommendationsApi() async { + final response = await NetworkApiServices() + .getApi(ApiUrls.getMultibaggerRecommendations, isAuth: true); + // log(response.data.toString()); + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + return response; + } else { + return ResponseData( + responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } +}