Merge branch 'main' into product
This commit is contained in:
@@ -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<HomeScreen> {
|
||||
GlobalKey<ScaffoldState> _scaffoldKey1 = GlobalKey<ScaffoldState>();
|
||||
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<HomeScreen> {
|
||||
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<HomeScreen> {
|
||||
),
|
||||
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<HomeScreen> {
|
||||
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<HomeScreen> {
|
||||
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<HomeScreen> {
|
||||
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: [
|
||||
|
||||
@@ -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<ShortTrade> {
|
||||
GlobalKey<ScaffoldState> _scaffoldKey1 = GlobalKey<ScaffoldState>();
|
||||
List<String> 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<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
// // ),
|
||||
// ),
|
||||
// ),
|
||||
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<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
onTap: () {},
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 100,
|
||||
)
|
||||
],
|
||||
@@ -343,7 +318,7 @@ class _ShortTradeState extends State<ShortTrade> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget ExitedCallsTab() {
|
||||
Widget ExitedCallsTab(CallRecommendationsModel callRecommendationsModel) {
|
||||
List<Map<String, String>> cardSwing = [
|
||||
{
|
||||
'text': 'Indiabulls Housing Finance Ltd',
|
||||
@@ -436,22 +411,38 @@ class _ShortTradeState extends State<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
Color(0xFF3A3A3A),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
borderGradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
@@ -552,13 +543,13 @@ class _ShortTradeState extends State<ShortTrade> {
|
||||
),
|
||||
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<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
Color(0xFF3A3A3A),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
borderGradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
@@ -710,13 +701,13 @@ class _ShortTradeState extends State<ShortTrade> {
|
||||
),
|
||||
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<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
}
|
||||
|
||||
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<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
Color(0xFF3A3A3A),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
borderGradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
@@ -859,20 +852,22 @@ class _ShortTradeState extends State<ShortTrade> {
|
||||
],
|
||||
),
|
||||
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<ShortTrade> {
|
||||
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<ShortTrade> {
|
||||
width: 126.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
color: Color(0Xff6C0000),
|
||||
color: const Color(0Xff6C0000),
|
||||
),
|
||||
child: Center(child: text16W500(text)),
|
||||
)
|
||||
|
||||
@@ -21,7 +21,6 @@ class _SideMenuState extends State<SideMenu> {
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
GetProfile().GetProfileAPI();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -132,9 +131,7 @@ class _SideMenuState extends State<SideMenu> {
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18W400(
|
||||
//ProfileObj!.data!.userName ??
|
||||
""),
|
||||
text18W400(ProfileObj!.data!.userName ?? ""),
|
||||
sizedBoxHeight(4.h),
|
||||
text18W400('My Profile'),
|
||||
],
|
||||
|
||||
@@ -65,10 +65,29 @@ class _ContactUsDetailsScreenState extends State<ContactUsDetailsScreen> {
|
||||
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,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
@@ -11,9 +12,15 @@ 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';
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
const LoginScreen({super.key});
|
||||
@@ -33,6 +40,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// final CounterBloc counterbloc = BlocProvider.of<CounterBloc>(context);
|
||||
//final sendOtpBloc = context.read<SendOtpBloc>();
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
_onBackButtonPressed(context);
|
||||
@@ -41,343 +51,383 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
extendBody: true,
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeft(),
|
||||
const CommonBlurRight(),
|
||||
Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
||||
child: Form(
|
||||
key: _sendotpform,
|
||||
child: ListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Traders Circuit",
|
||||
style: TextStyle(
|
||||
fontFamily: 'hiragino',
|
||||
color: Colors.white,
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 42.h,
|
||||
),
|
||||
const Text(
|
||||
"Lets get started ",
|
||||
style: TextStyle(
|
||||
fontFamily: 'hiragino',
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
text18W800("Enter your mobile number to get otp"),
|
||||
SizedBox(
|
||||
height: 35.h,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: GlassmorphicContainer(
|
||||
width: 60,
|
||||
height: 50,
|
||||
borderRadius: 8,
|
||||
blur: 10,
|
||||
alignment: Alignment.center,
|
||||
border: 0.8,
|
||||
linearGradient: LinearGradient(
|
||||
body: BlocProvider<SendOtpBloc>(
|
||||
create: (context) => SendOtpBloc(),
|
||||
child: Stack(
|
||||
children: [
|
||||
const CommonBlurLeft(),
|
||||
const CommonBlurRight(),
|
||||
Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16, vertical: 16),
|
||||
child: Form(
|
||||
key: _sendotpform,
|
||||
child: ListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Traders Circuit",
|
||||
style: TextStyle(
|
||||
fontFamily: 'hiragino',
|
||||
color: Colors.white,
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 42.h,
|
||||
),
|
||||
//bloc implementation
|
||||
/* GestureDetector(
|
||||
onTap: () {
|
||||
counterbloc.add(NumberIncreaseEvent());
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 80.h,
|
||||
child: Text(
|
||||
"click me",
|
||||
style: TextStyle(
|
||||
fontFamily: 'hiragino',
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (state is UpdateState)
|
||||
Text(
|
||||
"${state.counter}",
|
||||
style: TextStyle(
|
||||
fontFamily: 'hiragino',
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
*/
|
||||
const Text(
|
||||
"Lets get started ",
|
||||
style: TextStyle(
|
||||
fontFamily: 'hiragino',
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
text18W800("Enter your mobile number to get otp"),
|
||||
SizedBox(
|
||||
height: 35.h,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: GlassmorphicContainer(
|
||||
width: 60,
|
||||
height: 50,
|
||||
borderRadius: 8,
|
||||
blur: 10,
|
||||
alignment: Alignment.center,
|
||||
border: 0.8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.1),
|
||||
const Color(0xFFFFFFFF)
|
||||
.withOpacity(0.05),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.1),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.05),
|
||||
const Color(0xff9A0000).withOpacity(0.5),
|
||||
const Color(0xFFffffff).withOpacity(0.5),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xff9A0000).withOpacity(0.5),
|
||||
const Color(0xFFffffff).withOpacity(0.5),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// SvgPicture.asset("assets/images/svg/india.svg"),
|
||||
Image.asset(
|
||||
"assets/images/png/india.png",
|
||||
height: 25.h,
|
||||
width: 25.h,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 2,
|
||||
),
|
||||
const Text(
|
||||
"+91",
|
||||
style: TextStyle(
|
||||
fontFamily: 'hiragino',
|
||||
fontSize: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// SvgPicture.asset("assets/images/svg/india.svg"),
|
||||
Image.asset(
|
||||
"assets/images/png/india.png",
|
||||
height: 25.h,
|
||||
width: 25.h,
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(
|
||||
width: 2,
|
||||
),
|
||||
const Text(
|
||||
"+91",
|
||||
style: TextStyle(
|
||||
fontFamily: 'hiragino',
|
||||
fontSize: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: 285.w,
|
||||
child: CustomTextFormField(
|
||||
texttype: TextInputType.phone,
|
||||
textEditingController: phonecontroller,
|
||||
// validator: (value) {
|
||||
// if (value.isEmpty) {
|
||||
// return 'Enter your phone number';
|
||||
// } else if (!RegExp(r'(^(?:[+0]9)?[0-9]{10}$)')
|
||||
// .hasMatch(value)) {
|
||||
// return 'Enter a valid phone number';
|
||||
// } else if (!isValidPhoneNumber(value)) {
|
||||
// return 'Phone number cannot contain 10 zeros';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(10),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[0-9]')),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: 285.w,
|
||||
child: CustomTextFormField(
|
||||
texttype: TextInputType.phone,
|
||||
textEditingController: phonecontroller,
|
||||
// validator: (value) {
|
||||
// if (value.isEmpty) {
|
||||
// return 'Enter your phone number';
|
||||
// } else if (!RegExp(r'(^(?:[+0]9)?[0-9]{10}$)')
|
||||
// .hasMatch(value)) {
|
||||
// return 'Enter a valid phone number';
|
||||
// } else if (!isValidPhoneNumber(value)) {
|
||||
// return 'Phone number cannot contain 10 zeros';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(10),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[0-9]')),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
text14W300(
|
||||
"We’ll send six digit code to the registered number. Standard data rates may apply"),
|
||||
SizedBox(
|
||||
height: 65.h,
|
||||
),
|
||||
|
||||
BlocConsumer<SendOtpBloc, SendOtpState>(
|
||||
listener: (context, state) {
|
||||
if (state == SendOtpState.success) {
|
||||
WidgetsBinding.instance
|
||||
?.addPostFrameCallback((_) {
|
||||
Get.toNamed(RouteName.verifyotp, arguments: {
|
||||
"phonenumber": phonecontroller.text,
|
||||
});
|
||||
});
|
||||
} else if (state == SendOtpState.failure) {
|
||||
Utils.showToast("Oops something went wrong");
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
print(state);
|
||||
if (state == SendOtpState.loading) {
|
||||
return Center(
|
||||
child: Container(
|
||||
height: 40,
|
||||
width: 40,
|
||||
child: CircularProgressIndicator()));
|
||||
}
|
||||
return CommonBtn(
|
||||
text: "Login/Signup",
|
||||
onTap: () async {
|
||||
final isValid =
|
||||
_sendotpform.currentState?.validate();
|
||||
if (isValid!) {
|
||||
FocusManager.instance.primaryFocus
|
||||
?.unfocus();
|
||||
if (isValid != null && isValid) {
|
||||
Map<String, String> myLoginData = {
|
||||
"mobile_number": phonecontroller.text,
|
||||
};
|
||||
context
|
||||
.read<SendOtpBloc>()
|
||||
.add(SendOtp(myLoginData));
|
||||
} else {
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'Please enter valid phone number'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}),
|
||||
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
text14W300(
|
||||
"By continuing, you agree to our Terms & Conditions"),
|
||||
SizedBox(
|
||||
height: 45.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 0.2.h,
|
||||
width: 108.w,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(
|
||||
width: 22.w,
|
||||
),
|
||||
text18W600("OR"),
|
||||
SizedBox(
|
||||
width: 22.w,
|
||||
),
|
||||
Container(
|
||||
height: 0.2.h,
|
||||
width: 108.w,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 40.h,
|
||||
),
|
||||
GlassmorphicContainer(
|
||||
width: double.infinity,
|
||||
height: 55.h,
|
||||
borderRadius: 8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.1),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.05),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
border: 0.3,
|
||||
blur: 10,
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFAF2E89).withOpacity(0.2),
|
||||
const Color(0xFFA23E31).withOpacity(0.2),
|
||||
const Color(0xFF0000).withOpacity(0.2),
|
||||
],
|
||||
stops: const [
|
||||
0.3,
|
||||
0.6,
|
||||
1,
|
||||
]),
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/apple.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 7.h,
|
||||
),
|
||||
text16W400("Continue with apple"),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
text14W300(
|
||||
"We’ll send six digit code to the registered number. Standard data rates may apply"),
|
||||
SizedBox(
|
||||
height: 65.h,
|
||||
),
|
||||
CommonBtn(
|
||||
text: "Login/Signup",
|
||||
onTap: () async {
|
||||
final isValid =
|
||||
_sendotpform.currentState?.validate();
|
||||
if (isValid!) {
|
||||
utils.loader();
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
|
||||
Map<String, String> myLoginData = {
|
||||
"mobile_number": phonecontroller.text,
|
||||
};
|
||||
|
||||
var resp =
|
||||
await SendOtpAPI(myLoginData).sendOtpApi();
|
||||
print(resp.status);
|
||||
print('Api msg : ${resp.message}');
|
||||
|
||||
if (resp.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("api response is ${resp.data}");
|
||||
Utils.showToast("OTP sent successfully");
|
||||
|
||||
Map<String, dynamic> res = resp.data;
|
||||
print(res);
|
||||
|
||||
Get.toNamed(RouteName.verifyotp, arguments: {
|
||||
"phonenumber": phonecontroller.text
|
||||
});
|
||||
} else {
|
||||
Get.back();
|
||||
Utils.showToast(resp.message);
|
||||
print('Api msg : ${resp.message}');
|
||||
}
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Error", "Please Enter Login Credentials",
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM);
|
||||
}
|
||||
}),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
text14W300(
|
||||
"By continuing, you agree to our Terms & Conditions"),
|
||||
SizedBox(
|
||||
height: 45.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 0.2.h,
|
||||
width: 108.w,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(
|
||||
width: 22.w,
|
||||
),
|
||||
text18W600("OR"),
|
||||
SizedBox(
|
||||
width: 22.w,
|
||||
),
|
||||
Container(
|
||||
height: 0.2.h,
|
||||
width: 108.w,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 40.h,
|
||||
),
|
||||
GlassmorphicContainer(
|
||||
width: double.infinity,
|
||||
height: 55.h,
|
||||
borderRadius: 8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.1),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.05),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
border: 0.3,
|
||||
blur: 10,
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFAF2E89).withOpacity(0.2),
|
||||
const Color(0xFFA23E31).withOpacity(0.2),
|
||||
const Color(0xFF0000).withOpacity(0.2),
|
||||
],
|
||||
stops: const [
|
||||
0.3,
|
||||
0.6,
|
||||
1,
|
||||
]),
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/apple.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 7.h,
|
||||
),
|
||||
text16W400("Continue with apple"),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15.h,
|
||||
),
|
||||
GlassmorphicContainer(
|
||||
width: double.infinity,
|
||||
height: 55.h,
|
||||
borderRadius: 8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.1),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.05),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
border: 0.5,
|
||||
blur: 10,
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFAF2E89).withOpacity(0.2),
|
||||
const Color(0xFFA23E31).withOpacity(0.2),
|
||||
const Color(0xFF0000).withOpacity(0.2),
|
||||
],
|
||||
stops: const [
|
||||
0.3,
|
||||
0.6,
|
||||
1,
|
||||
]),
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/google.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 7.h,
|
||||
),
|
||||
text16W400(
|
||||
"Continue with google",
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 15.h,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 45.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
},
|
||||
child: text16W700(
|
||||
"Continue as guest",
|
||||
GlassmorphicContainer(
|
||||
width: double.infinity,
|
||||
height: 55.h,
|
||||
borderRadius: 8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.1),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.05),
|
||||
],
|
||||
stops: const [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
border: 0.5,
|
||||
blur: 10,
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFAF2E89).withOpacity(0.2),
|
||||
const Color(0xFFA23E31).withOpacity(0.2),
|
||||
const Color(0xFF0000).withOpacity(0.2),
|
||||
],
|
||||
stops: const [
|
||||
0.3,
|
||||
0.6,
|
||||
1,
|
||||
]),
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/png/google.png",
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 7.h,
|
||||
),
|
||||
text16W400(
|
||||
"Continue with google",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 45.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
},
|
||||
child: text16W700(
|
||||
"Continue as guest",
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -419,4 +469,5 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
);
|
||||
});
|
||||
return exitApp ?? false;
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@@ -20,7 +22,7 @@ int? isKycUpdated;
|
||||
int? isSecuredAccess;
|
||||
|
||||
class VerifyOTP extends StatefulWidget {
|
||||
const VerifyOTP({super.key});
|
||||
VerifyOTP({super.key});
|
||||
|
||||
@override
|
||||
State<VerifyOTP> createState() => _VerifyOTPState();
|
||||
@@ -44,6 +46,7 @@ class _VerifyOTPState extends State<VerifyOTP> {
|
||||
if (isValid!) {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
Utils.loader();
|
||||
// print("PLAYER ID ==> ${prefs.getString("playerId")}");
|
||||
Map<String, String> updata = {
|
||||
"mobile_number": phonenumber.toString(),
|
||||
"otp": pincode.text,
|
||||
@@ -51,6 +54,7 @@ class _VerifyOTPState extends State<VerifyOTP> {
|
||||
};
|
||||
final resp = await VerifyNumberAPI(updata).verifynumberApi();
|
||||
if (resp.status == ResponseStatus.SUCCESS) {
|
||||
log(resp.data.toString());
|
||||
Get.back();
|
||||
isUserExist = resp.data["data"]["user_account_exist"];
|
||||
isProfileUpdated = resp.data["data"]["user_data"]["profile_updated"];
|
||||
@@ -101,7 +105,7 @@ class _VerifyOTPState extends State<VerifyOTP> {
|
||||
} else {
|
||||
Get.back();
|
||||
String? message = resp.message;
|
||||
Utils.showToast("$message");
|
||||
Utils.showToast(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,21 +113,22 @@ class _VerifyOTPState extends State<VerifyOTP> {
|
||||
@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<VerifyOTP> {
|
||||
fieldHeight: 60.h,
|
||||
fieldWidth: 60.w,
|
||||
),
|
||||
animationDuration: Duration(milliseconds: 300),
|
||||
animationDuration: const Duration(milliseconds: 300),
|
||||
enableActiveFill: true,
|
||||
controller: pincode,
|
||||
onCompleted: (v) {
|
||||
|
||||
@@ -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<SplashScreen>
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user