Merge branch 'main' into product
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class ContactUsController extends GetxController {
|
||||
//contact us page controller
|
||||
RxList<File?> attachmentFileList = [File("")].obs;
|
||||
RxList<String> attachmentPathNameList = [""].obs;
|
||||
|
||||
RxList<dynamic> contactUsDetailsChatContent = [].obs;
|
||||
//contact us details page controller
|
||||
RxList<File?> attachmentFileDetailsList = [File("")].obs;
|
||||
RxList<String> attachmentPathNameDetailsList = [""].obs;
|
||||
@@ -35,5 +35,8 @@ class ContactUsController extends GetxController {
|
||||
return DateFormat("dd MMM yyyy, hh:mm a").format(dateTime.toLocal());
|
||||
}
|
||||
|
||||
|
||||
RxList<dynamic> contactUsDetailsChatContent = [].obs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
9
lib/controller/products_controller.dart
Normal file
9
lib/controller/products_controller.dart
Normal file
@@ -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();
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import 'package:traderscircuit/Utils/utils.dart';
|
||||
import '../../Utils/base_manager.dart';
|
||||
import 'base_api_services.dart';
|
||||
|
||||
class NetworkApiServices extends BaseApiServices {
|
||||
class NetworkApiServices {
|
||||
Dio dio = Dio();
|
||||
String basicAuth = 'Basic ' +
|
||||
base64.encode(
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
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:shared_preferences/shared_preferences.dart';
|
||||
@@ -13,6 +15,9 @@ import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:traderscircuit/resources/routes/routes.dart';
|
||||
import 'package:onesignal_flutter/onesignal_flutter.dart';
|
||||
|
||||
import 'view_model/LoginPage/Loginbloc.dart';
|
||||
import 'view_model/SendOtp/sendOtpbloc.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
@@ -24,6 +29,7 @@ Future<void> 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();
|
||||
@@ -39,7 +45,16 @@ Future<void> main() async {
|
||||
);
|
||||
SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
]).then((value) => runApp(const MyApp()));
|
||||
]).then((value) => runApp(MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<CounterBloc>(
|
||||
create: (context) => CounterBloc(),
|
||||
),
|
||||
BlocProvider<SendOtpBloc>(
|
||||
create: (context) => SendOtpBloc(),
|
||||
),
|
||||
// Add more BlocProviders for other Blocs here if needed
|
||||
],child: const MyApp())));
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
|
||||
199
lib/model/ProductsModel/call_recommendations_model.dart
Normal file
199
lib/model/ProductsModel/call_recommendations_model.dart
Normal file
@@ -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<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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>? activeCalls;
|
||||
List<ActiveCalls>? exitedCalls;
|
||||
|
||||
Data({this.activeCalls, this.exitedCalls});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
if (json['active_calls'] != null) {
|
||||
activeCalls = <ActiveCalls>[];
|
||||
json['active_calls'].forEach((v) {
|
||||
activeCalls!.add(ActiveCalls.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['exited_calls'] != null) {
|
||||
exitedCalls = <ActiveCalls>[];
|
||||
json['exited_calls'].forEach((v) {
|
||||
exitedCalls!.add(ActiveCalls.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
productName = json['product_name'];
|
||||
isActive = json['is_active'];
|
||||
createdAt = json['created_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
isActive = json['is_active'];
|
||||
createdAt = json['created_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['is_active'] = isActive;
|
||||
data['created_at'] = createdAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
140
lib/model/ProductsModel/list_of_products_model.dart
Normal file
140
lib/model/ProductsModel/list_of_products_model.dart
Normal file
@@ -0,0 +1,140 @@
|
||||
class ListOfProductsModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
ListOfProductsModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
ListOfProductsModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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>? productsData;
|
||||
|
||||
Data({this.id, this.title, this.productsData});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
if (json['products_data'] != null) {
|
||||
productsData = <ProductsData>[];
|
||||
json['products_data'].forEach((v) {
|
||||
productsData!.add(ProductsData.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
createdAt = json['created_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['created_at'] = createdAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class AppRoutes {
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.verifyotp,
|
||||
page: () => const VerifyOTP(),
|
||||
page: () => VerifyOTP(),
|
||||
),
|
||||
|
||||
//secureaccess
|
||||
|
||||
@@ -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());
|
||||
|
||||
24
lib/view_model/LoginPage/Loginbloc.dart
Normal file
24
lib/view_model/LoginPage/Loginbloc.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import 'Loginobserver.dart';
|
||||
|
||||
class CounterBloc extends Bloc<CounterEvents, CounterStates> {
|
||||
int counter = 0;
|
||||
|
||||
CounterBloc() : super(UpdateState(0)) {
|
||||
on<NumberIncreaseEvent>(onNumberIncrease);
|
||||
on<NumberDecreaseEvent>(onNumberDecrease);
|
||||
}
|
||||
|
||||
void onNumberIncrease(
|
||||
NumberIncreaseEvent event, Emitter<CounterStates> emit) async {
|
||||
counter = counter + 1;
|
||||
emit(UpdateState(counter));
|
||||
}
|
||||
|
||||
void onNumberDecrease(
|
||||
NumberDecreaseEvent event, Emitter<CounterStates> emit) async {
|
||||
counter = counter - 1;
|
||||
emit(UpdateState(counter));
|
||||
}
|
||||
}
|
||||
14
lib/view_model/LoginPage/Loginobserver.dart
Normal file
14
lib/view_model/LoginPage/Loginobserver.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
class CounterEvents {}
|
||||
|
||||
class NumberIncreaseEvent extends CounterEvents {}
|
||||
|
||||
class NumberDecreaseEvent extends CounterEvents {}
|
||||
|
||||
class CounterStates {}
|
||||
|
||||
class InitialState extends CounterStates {}
|
||||
|
||||
class UpdateState extends CounterStates {
|
||||
final int counter;
|
||||
UpdateState(this.counter);
|
||||
}
|
||||
75
lib/view_model/ProductsApi/products_api.dart
Normal file
75
lib/view_model/ProductsApi/products_api.dart
Normal file
@@ -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<ResponseData<dynamic>> getListOfProducts() async {
|
||||
final response = await NetworkApiServices()
|
||||
.getApi(ApiUrls.getListOfProducts, isAuth: true);
|
||||
log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getOptionsRecommendationsApi() async {
|
||||
final response = await NetworkApiServices()
|
||||
.getApi(ApiUrls.getOptionsRecommendations, isAuth: true);
|
||||
// log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getSwingTradeRecommendationsApi() async {
|
||||
final response = await NetworkApiServices()
|
||||
.getApi(ApiUrls.getSwingTradeRecommendations, isAuth: true);
|
||||
// log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getMultibaggerRecommendationsApi() async {
|
||||
final response = await NetworkApiServices()
|
||||
.getApi(ApiUrls.getMultibaggerRecommendations, isAuth: true);
|
||||
// log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
24
lib/view_model/SendOtp/sendOtpObserver.dart
Normal file
24
lib/view_model/SendOtp/sendOtpObserver.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
// Define events
|
||||
abstract class SendOtpEvent {
|
||||
const SendOtpEvent();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class SendOtp extends SendOtpEvent {
|
||||
final Map<String, String> loginData;
|
||||
SendOtp(this.loginData){
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object> get props => [loginData];
|
||||
|
||||
}
|
||||
|
||||
// Define states
|
||||
enum SendOtpState { initial, loading, success, failure }
|
||||
|
||||
33
lib/view_model/SendOtp/sendOtpbloc.dart
Normal file
33
lib/view_model/SendOtp/sendOtpbloc.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../Utils/base_manager.dart';
|
||||
import '../../resources/routes/route_name.dart';
|
||||
import '../Login/send_otp_api.dart';
|
||||
import 'sendOtpObserver.dart';
|
||||
|
||||
class SendOtpBloc extends Bloc<SendOtpEvent, SendOtpState> {
|
||||
SendOtpBloc() : super(SendOtpState.initial) {
|
||||
on<SendOtp>(mapEventToState);
|
||||
}
|
||||
Future<void> mapEventToState(
|
||||
SendOtp event, Emitter<SendOtpState> emit) async {
|
||||
if (event is SendOtp) {
|
||||
emit(SendOtpState.loading);
|
||||
try {
|
||||
final loginData = event.loginData;
|
||||
var resp = await SendOtpAPI(loginData).sendOtpApi();
|
||||
|
||||
if (resp.status == ResponseStatus.SUCCESS) {
|
||||
emit(SendOtpState.success);
|
||||
} else {
|
||||
emit(SendOtpState.failure);
|
||||
}
|
||||
} catch (e) {
|
||||
emit(SendOtpState.failure);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user