From a8c377787d96339f68f7777bb730f7cf2fe0adf6 Mon Sep 17 00:00:00 2001 From: Rajshinde046 Date: Wed, 8 May 2024 18:48:45 +0530 Subject: [PATCH] explore unseen view more --- lib/Utils/api_urls.dart | 3 + .../explore_unseen_model.dart | 300 +++++++++++ lib/model/HomeModel/home_model.dart | 6 +- lib/view/MainScreen/ExploreUnseen.dart | 360 +++++++++----- lib/view/MainScreen/HomeScreen.dart | 464 +++++++++--------- lib/view_model/ExploreApi/explore_api.dart | 25 + pubspec.lock | 58 +-- 7 files changed, 815 insertions(+), 401 deletions(-) create mode 100644 lib/model/ExploreUnseenModel/explore_unseen_model.dart create mode 100644 lib/view_model/ExploreApi/explore_api.dart diff --git a/lib/Utils/api_urls.dart b/lib/Utils/api_urls.dart index 076031e..f5b02ad 100644 --- a/lib/Utils/api_urls.dart +++ b/lib/Utils/api_urls.dart @@ -76,4 +76,7 @@ class ApiUrls { //Home static String getHome = "${base}home-page-details"; + + //explore unseen + static String getExplore = "${base}get-explore-the-unseen-recommendations"; } diff --git a/lib/model/ExploreUnseenModel/explore_unseen_model.dart b/lib/model/ExploreUnseenModel/explore_unseen_model.dart new file mode 100644 index 0000000..5a56283 --- /dev/null +++ b/lib/model/ExploreUnseenModel/explore_unseen_model.dart @@ -0,0 +1,300 @@ +class ExploreModel { + String? status; + int? statusCode; + String? message; + Data? data; + + ExploreModel({this.status, this.statusCode, this.message, this.data}); + + ExploreModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + List? exploreTheUnseenActiveCalls; + List? exploreTheUnseenExitedCalls; + + Data({this.exploreTheUnseenActiveCalls, this.exploreTheUnseenExitedCalls}); + + Data.fromJson(Map json) { + if (json['explore_the_unseen_active_calls'] != null) { + exploreTheUnseenActiveCalls = []; + json['explore_the_unseen_active_calls'].forEach((v) { + exploreTheUnseenActiveCalls! + .add(new ExploreTheUnseenActiveCalls.fromJson(v)); + }); + } + if (json['explore_the_unseen_exited_calls'] != null) { + exploreTheUnseenExitedCalls = []; + json['explore_the_unseen_exited_calls'].forEach((v) { + exploreTheUnseenExitedCalls! + .add(new ExploreTheUnseenExitedCalls.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.exploreTheUnseenActiveCalls != null) { + data['explore_the_unseen_active_calls'] = + this.exploreTheUnseenActiveCalls!.map((v) => v.toJson()).toList(); + } + if (this.exploreTheUnseenExitedCalls != null) { + data['explore_the_unseen_exited_calls'] = + this.exploreTheUnseenExitedCalls!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ExploreTheUnseenActiveCalls { + int? id; + int? productTypeXid; + int? recommendationActionsXid; + String? stockName; + String? instrumentKey; + String? stockImage; + String? qty; + String? duration; + String? currentPrice; + String? buyPrice; + String? targetPrice; + String? stopLoss; + int? isSendRecommendationNow; + String? scheduleDateTime; + String? createdAt; + String? docs; + ProductTypeData? productTypeData; + ActionData? actionData; + + ExploreTheUnseenActiveCalls( + {this.id, + this.productTypeXid, + 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.docs, + this.productTypeData, + this.actionData}); + + ExploreTheUnseenActiveCalls.fromJson(Map json) { + id = json['id']; + productTypeXid = json['product_type_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']; + docs = json['docs']; + productTypeData = json['product_type_data'] != null + ? new ProductTypeData.fromJson(json['product_type_data']) + : null; + actionData = json['action_data'] != null + ? new ActionData.fromJson(json['action_data']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['product_type_xid'] = this.productTypeXid; + data['recommendation_actions_xid'] = this.recommendationActionsXid; + data['stock_name'] = this.stockName; + data['instrument_key'] = this.instrumentKey; + data['stock_image'] = this.stockImage; + data['qty'] = this.qty; + data['duration'] = this.duration; + data['current_price'] = this.currentPrice; + data['buy_price'] = this.buyPrice; + data['target_price'] = this.targetPrice; + data['stop_loss'] = this.stopLoss; + data['is_send_recommendation_now'] = this.isSendRecommendationNow; + data['schedule_date_time'] = this.scheduleDateTime; + data['created_at'] = this.createdAt; + data['docs'] = this.docs; + if (this.productTypeData != null) { + data['product_type_data'] = this.productTypeData!.toJson(); + } + if (this.actionData != null) { + data['action_data'] = this.actionData!.toJson(); + } + return data; + } +} + +class ExploreTheUnseenExitedCalls { + int? id; + int? productTypeXid; + int? recommendationActionsXid; + String? stockName; + String? instrumentKey; + String? stockImage; + String? qty; + String? duration; + String? currentPrice; + String? buyPrice; + String? targetPrice; + String? stopLoss; + int? isSendRecommendationNow; + String? scheduleDateTime; + String? createdAt; + String? docs; + ProductTypeData? productTypeData; + ActionData? actionData; + + ExploreTheUnseenExitedCalls( + {this.id, + this.productTypeXid, + 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.docs, + this.productTypeData, + this.actionData}); + + ExploreTheUnseenExitedCalls.fromJson(Map json) { + id = json['id']; + productTypeXid = json['product_type_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']; + docs = json['docs']; + productTypeData = json['product_type_data'] != null + ? new ProductTypeData.fromJson(json['product_type_data']) + : null; + actionData = json['action_data'] != null + ? new ActionData.fromJson(json['action_data']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['product_type_xid'] = this.productTypeXid; + data['recommendation_actions_xid'] = this.recommendationActionsXid; + data['stock_name'] = this.stockName; + data['instrument_key'] = this.instrumentKey; + data['stock_image'] = this.stockImage; + data['qty'] = this.qty; + data['duration'] = this.duration; + data['current_price'] = this.currentPrice; + data['buy_price'] = this.buyPrice; + data['target_price'] = this.targetPrice; + data['stop_loss'] = this.stopLoss; + data['is_send_recommendation_now'] = this.isSendRecommendationNow; + data['schedule_date_time'] = this.scheduleDateTime; + data['created_at'] = this.createdAt; + data['docs'] = this.docs; + if (this.productTypeData != null) { + data['product_type_data'] = this.productTypeData!.toJson(); + } + if (this.actionData != null) { + data['action_data'] = this.actionData!.toJson(); + } + return data; + } +} + + +class ProductTypeData { + int? id; + String? title; + String? isActive; + Null? createdAt; + + ProductTypeData({this.id, this.title, this.isActive, this.createdAt}); + + ProductTypeData.fromJson(Map json) { + id = json['id']; + title = json['title']; + isActive = json['is_active']; + createdAt = json['created_at']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['title'] = this.title; + data['is_active'] = this.isActive; + data['created_at'] = this.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 = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['is_active'] = this.isActive; + data['created_at'] = this.createdAt; + return data; + } +} diff --git a/lib/model/HomeModel/home_model.dart b/lib/model/HomeModel/home_model.dart index b848f95..edb6696 100644 --- a/lib/model/HomeModel/home_model.dart +++ b/lib/model/HomeModel/home_model.dart @@ -393,6 +393,7 @@ class ContentByteVideo { String? image; String? isActive; String? createdAt; + String? link; ContentByteVideo( {this.id, @@ -404,7 +405,8 @@ class ContentByteVideo { this.categoryId, this.image, this.isActive, - this.createdAt}); + this.createdAt, + this.link}); ContentByteVideo.fromJson(Map json) { id = json['id']; @@ -417,6 +419,7 @@ class ContentByteVideo { image = json['image']; isActive = json['is_active']; createdAt = json['created_at']; + link = json['link']; } Map toJson() { @@ -431,6 +434,7 @@ class ContentByteVideo { data['image'] = this.image; data['is_active'] = this.isActive; data['created_at'] = this.createdAt; + data['link'] = this.link; return data; } } diff --git a/lib/view/MainScreen/ExploreUnseen.dart b/lib/view/MainScreen/ExploreUnseen.dart index 270b10f..fe3cb8c 100644 --- a/lib/view/MainScreen/ExploreUnseen.dart +++ b/lib/view/MainScreen/ExploreUnseen.dart @@ -1,12 +1,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_svg/svg.dart'; +import 'package:get/get.dart'; import 'package:glassmorphism/glassmorphism.dart'; import 'package:traderscircuit/Utils/Common/CommonAppbar.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/model/ExploreUnseenModel/explore_unseen_model.dart'; import 'package:traderscircuit/view/onBoarding/splashScreen1.dart'; +import 'package:traderscircuit/view_model/ExploreApi/explore_api.dart'; class ExploreUnseen extends StatefulWidget { const ExploreUnseen({super.key}); @@ -17,6 +19,19 @@ class ExploreUnseen extends StatefulWidget { class _ExploreUnseenState extends State { GlobalKey _scaffoldKey1 = GlobalKey(); + ExploreModel exploreModel = ExploreModel(); + + RxBool isApiCalling = true.obs; + + @override + void initState() { + ExploreApi().getExploreData().then((value) { + exploreModel = ExploreModel.fromJson(value.data); + isApiCalling.value = false; + }); + + super.initState(); + } @override Widget build(BuildContext context) { @@ -26,139 +41,226 @@ class _ExploreUnseenState extends State { extendBody: true, appBar: CommonAppbar(titleTxt: ''), - body: Stack(children: [ - CommonBlurLeft(), - CommonBlurRight(), - Stack(children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 16, - ), - child: ListView(physics: BouncingScrollPhysics(), children: [ - text22W600('Explore The Unseen'), - sizedBoxHeight(35.h), - Column( - children: [ - ActiveCallsTab(), - ], - ), - ])) - ]) - ]), - // bottomNavigationBar: bottomnavigationbar(mainController), - ); - } - - Widget ActiveCallsTab() { - return Column( - children: [ - sizedBoxHeight(30.h), - cardcallWidget( - text: 'Trident Ltd', - amount: '₹ 453 - ₹234', - pdfname: 'Download Pdf'), - sizedBoxHeight(30.h), - ], - ); - } - - Widget cardcallWidget( - {required String text, required String amount, required String pdfname}) { - return commonGlassContainer( - width: double.infinity, - height: 176.h, - borderradius: 8, - customWidget: Column( + body: Stack( children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - GlassmorphicContainer( - width: 47.w, - height: 47.h, - borderRadius: 100, - blur: 10, - alignment: Alignment.center, - border: 0.9, - linearGradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color(0xff3A3A3A), - Color(0xFF3A3A3A), - ], - ), - borderGradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color.fromRGBO(70, 5, 1, 0.8), - Color.fromRGBO(102, 102, 102, 0.8), - ], - ), - child: Center( - child: Image.asset( - 'assets/images/png/square_TRIDENT_com 1.png'), - ), - ), - sizedBoxWidth(15.w), - text18W600(text), - Spacer(), - Container( - width: 62.w, - height: 25.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.r), - color: Color(0xFFFFAD31), - ), - child: Center(child: text16W400_1B1B1B('Hold')), - ) - ], - ), - ), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFF3A3A3A), - ), - Padding( - padding: const EdgeInsets.all(20), - child: Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text14W400_979797('Initial Entry Price'), - sizedBoxHeight(5.h), - text15W600(amount) - ], - ), - Spacer(), - // sizedBoxWidth(50.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text14W400_979797('Report'), - sizedBoxHeight(5.h), - Row( - children: [ - // SvgPicture.asset('assets/images/svg/pdfsvg.svg'), - Image.asset( - 'assets/images/png/pdf.png', - height: 20.h, - width: 20.w, + CommonBlurLeft(), + CommonBlurRight(), + Obx( + () => isApiCalling.value + ? CircularProgressIndicator() + : Stack( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 16, ), - text15W600(pdfname), - ], - ) - ], - ) - ], - ), + child: isApiCalling.value + ? Center( + child: CircularProgressIndicator(), + ) + : ListView( + physics: BouncingScrollPhysics(), + children: [ + text22W600('Explore The Unseen'), + sizedBoxHeight(35.h), + ListView.builder( + shrinkWrap: true, + itemCount: exploreModel.data! + .exploreTheUnseenActiveCalls!.length, + itemBuilder: (context, index) { + return Column( + children: [ + commonGlassContainer( + width: double.infinity, + height: 176.h, + borderradius: 8, + customWidget: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, + horizontal: 16.w), + child: Row( + children: [ + GlassmorphicContainer( + width: 47.w, + height: 47.h, + borderRadius: 100, + blur: 10, + alignment: + Alignment.center, + border: 0.9, + linearGradient: + const LinearGradient( + begin: + Alignment.topLeft, + end: Alignment + .bottomRight, + colors: [ + Color(0xff3A3A3A), + Color(0xFF3A3A3A), + ], + ), + borderGradient: + const LinearGradient( + begin: + Alignment.topLeft, + end: Alignment + .bottomRight, + colors: [ + Color.fromRGBO( + 70, 5, 1, 0.8), + Color.fromRGBO(102, + 102, 102, 0.8), + ], + ), + child: Center( + child: Image.asset( + 'assets/images/png/square_TRIDENT_com 1.png'), + ), + ), + sizedBoxWidth(15.w), + text18W600( + exploreModel.data! + .exploreTheUnseenActiveCalls! + .elementAt( + index) + .stockName ?? + "", + ), + Spacer(), + Container( + width: 62.w, + height: 25.h, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 4.r), + color: exploreModel + .data! + .exploreTheUnseenActiveCalls! + .first + .recommendationActionsXid == + 1 + ? Colors.green + : exploreModel + .data! + .exploreTheUnseenActiveCalls! + .first + .recommendationActionsXid == + 2 + ? Colors.red + : exploreModel + .data! + .exploreTheUnseenActiveCalls! + .first + .recommendationActionsXid == + 3 + ? const Color( + 0xFFFFAD31) + : Colors + .white, + // Color(0xFFFFAD31), + ), + child: Center( + child: text16W400_1B1B1B(exploreModel + .data! + .exploreTheUnseenActiveCalls! + .first + .recommendationActionsXid == + 1 + ? "Buy" + : exploreModel + .data! + .exploreTheUnseenActiveCalls! + .first + .recommendationActionsXid == + 2 + ? "Sell" + : exploreModel.data!.exploreTheUnseenActiveCalls!.first.recommendationActionsXid == + 3 + ? "Hold" + : exploreModel.data!.exploreTheUnseenActiveCalls!.first.recommendationActionsXid == + 4 + ? "Exit" + : "")), + ) + ], + ), + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFF3A3A3A), + ), + Padding( + padding: + const EdgeInsets.all(20), + child: Row( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text14W400_979797( + 'Initial Entry Price'), + sizedBoxHeight(5.h), + text15W600(exploreModel + .data! + .exploreTheUnseenActiveCalls! + .elementAt( + index) + .buyPrice ?? + "") + ], + ), + Spacer(), + // sizedBoxWidth(50.w), + Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text14W400_979797( + 'Report'), + sizedBoxHeight(5.h), + Row( + children: [ + // SvgPicture.asset('assets/images/svg/pdfsvg.svg'), + Image.asset( + 'assets/images/png/pdf.png', + height: 20.h, + width: 20.w, + ), + text15W600( + "Download Pdf"), + ], + ) + ], + ) + ], + ), + ) + ], + ), + ), + sizedBoxHeight(30.h), + ], + ); + }, + ), + ], + ), + ), + ], + ), ) ], ), + // bottomNavigationBar: bottomnavigationbar(mainController), ); } } diff --git a/lib/view/MainScreen/HomeScreen.dart b/lib/view/MainScreen/HomeScreen.dart index bb0a7e0..7c8df8f 100644 --- a/lib/view/MainScreen/HomeScreen.dart +++ b/lib/view/MainScreen/HomeScreen.dart @@ -41,7 +41,6 @@ class _HomeScreenState extends State { ProductsController productsController = Get.put(ProductsController()); - @override void initState() { GetProfile().GetProfileAPI().then((value) { @@ -49,8 +48,8 @@ class _HomeScreenState extends State { }); HomeApi().getHomeData().then((value) { homeModel = HomeModel.fromJson(value.data); + isApiCalling.value = false; }); - isApiCalling.value = false; super.initState(); } @@ -96,25 +95,24 @@ class _HomeScreenState extends State { ), ], ), - body: Stack( - children: [ - const CommonBlurLeft(), - const CommonBlurRight(), - Stack(children: [ - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: isApiCalling.value - ? Center( - child: CircularProgressIndicator(), - ) - : ListView( - physics: const BouncingScrollPhysics(), - children: [ - - sizedBoxHeight(20.h), - Obx( - () => Text( + body: Obx( + () => Stack( + children: [ + const CommonBlurLeft(), + const CommonBlurRight(), + Stack(children: [ + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: isApiCalling.value + ? Center( + child: CircularProgressIndicator(), + ) + : ListView( + physics: const BouncingScrollPhysics(), + children: [ + sizedBoxHeight(20.h), + Text( "Welcome $userName", style: TextStyle( color: Colors.white, @@ -122,238 +120,244 @@ class _HomeScreenState extends State { fontFamily: 'hiragino', fontWeight: FontWeight.w500), ), - - ), - sizedBoxHeight(25.h), - SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( + sizedBoxHeight(25.h), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + commoncontainer( + width: 195.w, + text: 'NIFTY', + amount: '22,286.95', + rate: '+304.15 (+1.38%)'), + sizedBoxWidth(10.w), + commoncontainer( + width: 240.w, + text: 'BANKNIFTY', + amount: '22,286.95', + rate: '+896.10 (+1.94%)'), + ], + ), + ), + sizedBoxHeight(30.h), + Container( + width: double.infinity, + height: 1.h, + color: const Color(0xFF3A3A3A), + ), + sizedBoxHeight(30.h), + text22W500('View our products'), + sizedBoxHeight(30.h), + SizedBox( + height: 210, + child: GridView.builder( + physics: const NeverScrollableScrollPhysics(), + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: + 2, // number of items in each row + mainAxisSpacing: 8.0, // spacing between rows + crossAxisSpacing: + 8.0, // spacing between columns + childAspectRatio: 2.2, + ), + itemCount: homeModel.data!.products!.length, + itemBuilder: (context, index) { + return ProductWidget( + text: homeModel.data!.products! + .elementAt(index) + .title!, + subtext: "recommendation"); + }, + ), + ), + sizedBoxHeight(25.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ - commoncontainer( - width: 195.w, - text: 'NIFTY', - amount: '22,286.95', - rate: '+304.15 (+1.38%)'), + SvgPicture.asset( + 'assets/images/svg/Vector (2).svg'), sizedBoxWidth(10.w), - commoncontainer( - width: 240.w, - text: 'BANKNIFTY', - amount: '22,286.95', - rate: '+896.10 (+1.94%)'), + text18W500('UNLOCK NOW!'), ], ), - ), - sizedBoxHeight(30.h), - Container( - width: double.infinity, - height: 1.h, - color: const Color(0xFF3A3A3A), - ), - sizedBoxHeight(30.h), - text22W500('View our products'), - sizedBoxHeight(30.h), - SizedBox( - height: 210, - child: GridView.builder( - physics: const NeverScrollableScrollPhysics(), - gridDelegate: - const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: - 2, // number of items in each row - mainAxisSpacing: 8.0, // spacing between rows - crossAxisSpacing: - 8.0, // spacing between columns - childAspectRatio: 2.2, - ), - itemCount: homeModel.data!.products!.length, - itemBuilder: (context, index) { - return ProductWidget( - text: homeModel.data!.products! - .elementAt(index) - .title!, - subtext: "recommendation"); - }, + sizedBoxHeight(25.h), + Container( + width: double.infinity, + height: 1.h, + color: const Color(0xFF3A3A3A), ), - ), - sizedBoxHeight(25.h), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/svg/Vector (2).svg'), - sizedBoxWidth(10.w), - text18W500('UNLOCK NOW!'), - ], - ), - sizedBoxHeight(25.h), - Container( - width: double.infinity, - height: 1.h, - color: const Color(0xFF3A3A3A), - ), - sizedBoxHeight(25.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - text22W600('Explore The Unseen'), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.exploreUnseen); - }, - child: Container( - height: 35.h, - width: 105.w, - decoration: BoxDecoration( - color: const Color(0xFF3A3A3A) - .withOpacity(0.6), - borderRadius: BorderRadius.circular(5.r), - border: Border.all( - color: const Color(0xFF3A3A3A), - )), - child: Center(child: text16W500('View More')), - ), - ), - ], - ), - sizedBoxHeight(35.h), - DefaultTabController( - length: 2, - child: Column( + sizedBoxHeight(25.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - MyTabBar(), - SizedBox( - height: 250.h, - child: TabBarView( - children: [ - ActiveCallsTab(), - ExitedCallsTab(), - ], + text22W600('Explore The Unseen'), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.exploreUnseen); + }, + child: Container( + height: 35.h, + width: 105.w, + decoration: BoxDecoration( + color: const Color(0xFF3A3A3A) + .withOpacity(0.6), + borderRadius: + BorderRadius.circular(5.r), + border: Border.all( + color: const Color(0xFF3A3A3A), + )), + child: + Center(child: text16W500('View More')), ), ), ], ), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text22W600('Content Bytes'), - sizedBoxHeight(8.w), - Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, + sizedBoxHeight(35.h), + DefaultTabController( + length: 2, + child: Column( children: [ + MyTabBar(), SizedBox( - width: 240.w, - child: text16W400_DADADA( - 'The Beauty and Power of Video')), - // sizedBoxWidth(10.w), - const Spacer(), - Container( - height: 35.h, - width: 105.w, - decoration: BoxDecoration( - color: const Color(0xFF3A3A3A) - .withOpacity(0.6), - borderRadius: BorderRadius.circular(5.r), - border: Border.all( - color: const Color(0xFF3A3A3A), - ), - ), - child: Center( - child: InkWell( - onTap: () { - Get.toNamed(RouteName.contentbytes); - }, - child: text16W500('View More'), - ), + height: 250.h, + child: TabBarView( + children: [ + ActiveCallsTab(), + ExitedCallsTab(), + ], ), ), ], ), - 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( + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text22W600('Content Bytes'), + sizedBoxHeight(8.w), + Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: 240.w, + child: text16W400_DADADA( + 'The Beauty and Power of Video')), + // sizedBoxWidth(10.w), + const Spacer(), + Container( + height: 35.h, + width: 105.w, + decoration: BoxDecoration( + color: const Color(0xFF3A3A3A) + .withOpacity(0.6), + borderRadius: + BorderRadius.circular(5.r), + border: Border.all( + color: const Color(0xFF3A3A3A), + ), + ), + child: Center( + child: InkWell( onTap: () { - Get.to(() => const PlayerWidget(), - arguments: { - "video_url": "", - }); + Get.toNamed(RouteName.contentbytes); }, - child: Container( - height: 200.h, - width: double.infinity, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.r), - image: DecorationImage( - image: NetworkImage(homeModel - .data! - .contentByteVideo! - .image ?? - ""), + 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(() => const PlayerWidget(), + arguments: { + "video_url": homeModel + .data! + .contentByteVideo! + .link ?? + "", + }); + }, + child: Container( + height: 200.h, + width: double.infinity, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(8.r), + image: DecorationImage( + image: NetworkImage(homeModel + .data! + .contentByteVideo! + .image ?? + ""), + ), ), - ), - child: Center( - child: SvgPicture.asset( - 'assets/images/svg/gridicons_play.svg', - height: 56.h, - width: 56.w, + child: Center( + child: SvgPicture.asset( + 'assets/images/svg/gridicons_play.svg', + height: 56.h, + width: 56.w, + ), ), ), ), - ), - sizedBoxHeight(20.h), - Row( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - CircleAvatar( - radius: 23.r, - backgroundImage: NetworkImage( - homeModel - .data! - .contentByteVideo! - .title ?? - ""), - ), - sizedBoxWidth(10.w), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - text18W500(homeModel - .data! - .contentByteVideo! - .title ?? - ""), - // sizedBoxHeight(10.h), - text12W400_979797( - '20k views . 2 days ago'), - ], + sizedBoxHeight(20.h), + Row( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + CircleAvatar( + radius: 23.r, + backgroundImage: NetworkImage( + homeModel + .data! + .contentByteVideo! + .title ?? + ""), ), - ) - ], - ) - ], - ), - )) - ], - ), - ], - ), - ) - ]) - ], + sizedBoxWidth(10.w), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + text18W500(homeModel + .data! + .contentByteVideo! + .title ?? + ""), + // sizedBoxHeight(10.h), + text12W400_979797( + '20k views . 2 days ago'), + ], + ), + ) + ], + ) + ], + ), + )) + ], + ), + ], + ), + ) + ]) + ], + ), ), bottomNavigationBar: bottomnavigationbar(mainController), ), diff --git a/lib/view_model/ExploreApi/explore_api.dart b/lib/view_model/ExploreApi/explore_api.dart new file mode 100644 index 0000000..c10003a --- /dev/null +++ b/lib/view_model/ExploreApi/explore_api.dart @@ -0,0 +1,25 @@ +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 ExploreApi { + Future> getExploreData() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getExplore, + ); + 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; + } +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index c6b8f0f..cb7173a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -616,30 +616,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.4.9" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" - url: "https://pub.dev" - source: hosted - version: "10.0.0" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 - url: "https://pub.dev" - source: hosted - version: "2.0.1" lints: dependency: transitive description: @@ -708,26 +684,26 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.10.0" mime: dependency: transitive description: @@ -772,10 +748,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.8.3" path_drawing: dependency: transitive description: @@ -1278,14 +1254,6 @@ packages: url: "https://github.com/kishan06/videoPlayerKB.git" source: git version: "0.0.2" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 - url: "https://pub.dev" - source: hosted - version: "13.0.0" wakelock: dependency: transitive description: @@ -1326,6 +1294,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.1" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" win32: dependency: transitive description: @@ -1351,5 +1327,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.2.0-0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0"