firebase
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// File generated by FlutterFire CLI.
|
||||
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
|
||||
// ignore_for_file: type=lint
|
||||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||
import 'package:flutter/foundation.dart'
|
||||
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||
@@ -50,19 +50,19 @@ class DefaultFirebaseOptions {
|
||||
}
|
||||
|
||||
static const FirebaseOptions android = FirebaseOptions(
|
||||
apiKey: 'AIzaSyDA19anPZQE9wwK0Lbr-KMoa-dfIanZrlU',
|
||||
appId: '1:580254405290:android:77f13f510048b79e10b6d3',
|
||||
messagingSenderId: '580254405290',
|
||||
projectId: 'tradercircuit-b5744',
|
||||
storageBucket: 'tradercircuit-b5744.appspot.com',
|
||||
apiKey: 'AIzaSyCMQhYq9XDYcxNbCxM0aWl9Lu9-AI3BveU',
|
||||
appId: '1:307701736370:android:b11ba8d4970ce3b65d7aab',
|
||||
messagingSenderId: '307701736370',
|
||||
projectId: 'traders-circuit',
|
||||
storageBucket: 'traders-circuit.appspot.com',
|
||||
);
|
||||
|
||||
static const FirebaseOptions ios = FirebaseOptions(
|
||||
apiKey: 'AIzaSyDcB4KjuddPkpnWwqutw_4TlfKaOTZIXa0',
|
||||
appId: '1:580254405290:ios:94435ecb64979c4a10b6d3',
|
||||
messagingSenderId: '580254405290',
|
||||
projectId: 'tradercircuit-b5744',
|
||||
storageBucket: 'tradercircuit-b5744.appspot.com',
|
||||
apiKey: 'AIzaSyAX1quOawuuZYT8WuHjLNnfk_e6e6hdt-U',
|
||||
appId: '1:307701736370:ios:aad00e1335564a465d7aab',
|
||||
messagingSenderId: '307701736370',
|
||||
projectId: 'traders-circuit',
|
||||
storageBucket: 'traders-circuit.appspot.com',
|
||||
iosBundleId: 'com.example.traderscircuit',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
@@ -25,6 +27,16 @@ Future<void> main() async {
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
|
||||
FlutterError.onError = (errorDetails) {
|
||||
FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
|
||||
};
|
||||
// Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics
|
||||
PlatformDispatcher.instance.onError = (error, stack) {
|
||||
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
|
||||
return true;
|
||||
};
|
||||
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
OneSignal.shared.setAppId("af55bb59-5ce9-4d95-92b8-e30d9ed06a73");
|
||||
OneSignal.shared.promptUserForPushNotificationPermission();
|
||||
|
||||
@@ -58,4 +58,7 @@ class RouteName {
|
||||
|
||||
//stock deatils
|
||||
static const String stockDetails = '/stockDetails';
|
||||
|
||||
//option chain
|
||||
static const String optionChain = '/optionChain';
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:traderscircuit/Utils/Common/noInternet.dart';
|
||||
import 'package:traderscircuit/model/StockDetailsModel/stock_details_model.dart';
|
||||
import 'package:traderscircuit/resources/routes/route_name.dart';
|
||||
import 'package:traderscircuit/view/MainScreen/ExploreUnseen.dart';
|
||||
import 'package:traderscircuit/view/MainScreen/stockDetails/option_chain_screen.dart';
|
||||
import 'package:traderscircuit/view/MainScreen/stockDetails/stock_details_screen.dart';
|
||||
import 'package:traderscircuit/view/Sidemenu/AboutUs.dart';
|
||||
import 'package:traderscircuit/view/Sidemenu/ContentByte/ContentBytes.dart';
|
||||
@@ -191,10 +193,16 @@ class AppRoutes {
|
||||
GetPage(
|
||||
name: RouteName.myProfileScreen,
|
||||
page: () => const MyProfileScreen(),
|
||||
), //stock details
|
||||
),
|
||||
//stock details
|
||||
GetPage(
|
||||
name: RouteName.stockDetails,
|
||||
page: () => const StockDetailsScreen(),
|
||||
),
|
||||
//stock details
|
||||
GetPage(
|
||||
name: RouteName.optionChain,
|
||||
page: () => const OptionChainScreen(),
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
@@ -197,7 +197,12 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
SvgPicture.asset(
|
||||
'assets/images/svg/Vector (2).svg'),
|
||||
sizedBoxWidth(10.w),
|
||||
text18W500('UNLOCK NOW!'),
|
||||
InkWell(
|
||||
child: text18W500('UNLOCK NOW!'),
|
||||
onTap: () {
|
||||
throw Exception();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
|
||||
@@ -1,26 +1,18 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:async/async.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
import 'package:scgateway_flutter_plugin/scgateway_flutter_plugin.dart';
|
||||
import 'package:traderscircuit/Utils/Common/CommonBottomNavigation.dart';
|
||||
import 'package:traderscircuit/Utils/Common/CustomTextFormField.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/view/MainScreen/MainScreen.dart';
|
||||
import 'package:traderscircuit/view/MainScreen/Portfolio/Holdings.dart';
|
||||
import 'package:traderscircuit/view/Sidemenu/Sidemenu.dart';
|
||||
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
|
||||
|
||||
import '../../../model/SmallCaseModel/broker_account_model.dart';
|
||||
import '../../../view_model/SmallCaseApi/smallcase_api_methods.dart';
|
||||
|
||||
|
||||
302
lib/view/MainScreen/stockDetails/option_chain_screen.dart
Normal file
302
lib/view/MainScreen/stockDetails/option_chain_screen.dart
Normal file
@@ -0,0 +1,302 @@
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart' hide FormData;
|
||||
import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart';
|
||||
import 'package:traderscircuit/Utils/Common/sized_box.dart';
|
||||
import 'package:traderscircuit/Utils/text.dart';
|
||||
import 'package:traderscircuit/controller/products_controller.dart';
|
||||
import '../../../Utils/Common/CommonAppBar.dart';
|
||||
import '../../onBoarding/splashScreen1.dart';
|
||||
|
||||
class OptionChainScreen extends StatefulWidget {
|
||||
const OptionChainScreen({super.key});
|
||||
|
||||
@override
|
||||
State<OptionChainScreen> createState() => _OptionChainScreenState();
|
||||
}
|
||||
|
||||
class _OptionChainScreenState extends State<OptionChainScreen> {
|
||||
Color _indicatorColor = Color(0xff00C236);
|
||||
List<String> containerTexts = [
|
||||
"9 MAY",
|
||||
"10 MAY",
|
||||
"11 MAY",
|
||||
"12 MAY",
|
||||
"13 MAY"
|
||||
];
|
||||
ProductsController productsController = Get.put(ProductsController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
drawerEnableOpenDragGesture: false,
|
||||
extendBody: true,
|
||||
appBar: const CommonAppbar(
|
||||
titleTxt: "",
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeft(),
|
||||
const CommonBlurRight(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: DefaultTabController(
|
||||
length: 5, // Number of tabs
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16W400('TATA MOTORS'),
|
||||
text24W500('₹453.60'),
|
||||
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: () {
|
||||
productsController.selectedIndex.value = index;
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
topContainer(containerTexts[index], index),
|
||||
sizedBoxWidth(10.w),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
Table(
|
||||
border: TableBorder.symmetric(
|
||||
outside: BorderSide(
|
||||
width: 1,
|
||||
color: Color(0xFF4A73FB).withOpacity(0.3),
|
||||
),
|
||||
),
|
||||
columnWidths: {
|
||||
0: FlexColumnWidth(1),
|
||||
1: FlexColumnWidth(1),
|
||||
2: FlexColumnWidth(2),
|
||||
3: FlexColumnWidth(1),
|
||||
4: FlexColumnWidth(1),
|
||||
},
|
||||
children: [
|
||||
TableRow(
|
||||
decoration: BoxDecoration(color: Colors.transparent),
|
||||
children: [
|
||||
tableMainHeader('Calls'),
|
||||
tableMainHeader(''),
|
||||
tableMainHeader('Option Chain'),
|
||||
tableMainHeader(''),
|
||||
tableMainHeader('Puts'),
|
||||
],
|
||||
),
|
||||
TableRow(
|
||||
decoration: BoxDecoration(color: Color(0xff00295C)),
|
||||
children: [
|
||||
tableHeader('OI', 'change'),
|
||||
tableHeader('LTP', 'change'),
|
||||
tableHeader('Price', ''),
|
||||
tableHeader('LTP', 'change'),
|
||||
tableHeader('OI', 'change'),
|
||||
],
|
||||
),
|
||||
...List.generate(
|
||||
15,
|
||||
(index) => tableRow(index),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tableHeader(String text, String text1) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(
|
||||
text: text,
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.sp),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: "\n${text1}",
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.bold, fontSize: 11.sp)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tableMainHeader(String text) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 127.0),
|
||||
child: Text(text,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16.sp)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TableRow tableRow(int index) {
|
||||
return TableRow(
|
||||
decoration: BoxDecoration(
|
||||
color: index % 2 == 0 ? Colors.transparent : Colors.transparent,
|
||||
),
|
||||
children: [
|
||||
tableCell('1,43,875', '\n59,625'),
|
||||
tableCell('271.00', '\n-45.65'),
|
||||
tableCell('22,250', ''),
|
||||
tableCell('41.35', '\n-8.20'),
|
||||
tableCell('10,07,275', '\n2,71,400'),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget tableCell(String text, String text1) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(
|
||||
text: text,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: "\n${text1}",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 11.sp,
|
||||
color: Colors.green),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget topContainer(String text, int index) {
|
||||
return Obx(() {
|
||||
return productsController.selectedIndex.value == index
|
||||
? Container(
|
||||
height: 40.h,
|
||||
width: 126.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
color: const Color(0Xff0093FF),
|
||||
),
|
||||
child: Center(child: text16W500(text)),
|
||||
)
|
||||
: commonGlassContainer(
|
||||
width: 126.w,
|
||||
height: 40.h,
|
||||
borderradius: 5,
|
||||
customWidget: Center(child: text16W400(text)),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
List<FlSpot> listData(List<num> data) {
|
||||
return data.asMap().entries.map((e) {
|
||||
return FlSpot(e.key.toDouble(), e.value.toDouble());
|
||||
}).toList();
|
||||
}
|
||||
|
||||
class OptionChainTable extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Table(
|
||||
columnWidths: {
|
||||
0: FlexColumnWidth(1),
|
||||
1: FlexColumnWidth(1),
|
||||
2: FlexColumnWidth(1),
|
||||
3: FlexColumnWidth(1),
|
||||
4: FlexColumnWidth(1),
|
||||
5: FlexColumnWidth(1),
|
||||
},
|
||||
// border: TableBorder.all(color: Colors.white),
|
||||
children: [
|
||||
TableRow(
|
||||
decoration: BoxDecoration(color: Colors.black),
|
||||
children: [
|
||||
tableHeader('OI\nchange'),
|
||||
tableHeader('LTP\nchange'),
|
||||
tableHeader('Price'),
|
||||
tableHeader('LTP\nchange'),
|
||||
tableHeader('OI\nchange'),
|
||||
],
|
||||
),
|
||||
...List.generate(5, (index) => tableRow(index)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tableHeader(String text) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Text(text,
|
||||
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
TableRow tableRow(int index) {
|
||||
return TableRow(
|
||||
decoration: BoxDecoration(
|
||||
color: index % 2 == 0
|
||||
? Colors.black.withOpacity(0.8)
|
||||
: Colors.black.withOpacity(0.6),
|
||||
),
|
||||
children: [
|
||||
tableCell('1,43,875\n59,625'),
|
||||
tableCell('271.00\n-45.65'),
|
||||
tableCell('22,250'),
|
||||
tableCell('41.35\n-8.20'),
|
||||
tableCell('10,07,275\n2,71,400'),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget tableCell(String text) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Text(text, style: TextStyle(color: Colors.white)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import 'package:get/get.dart' hide FormData;
|
||||
import 'package:traderscircuit/Utils/text.dart';
|
||||
import 'package:traderscircuit/Utils/utils.dart';
|
||||
import 'package:traderscircuit/model/StockDetailsModel/stock_details_model.dart';
|
||||
import 'package:traderscircuit/resources/routes/route_name.dart';
|
||||
import 'package:traderscircuit/view_model/StockDetailsApi/stock_details_api.dart';
|
||||
|
||||
import 'dart:math';
|
||||
@@ -117,25 +118,32 @@ class _StockDetailsScreenState extends State<StockDetailsScreen> {
|
||||
children: [
|
||||
text25W600(
|
||||
"₹${stockDetailsModel!.data!.stockData!.averagePrice!.toString()}"),
|
||||
Container(
|
||||
width: 145,
|
||||
height: 40,
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFF0093FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/option_chain_icon.svg"),
|
||||
const Gap(5),
|
||||
text12W600("Option Chain"),
|
||||
],
|
||||
)),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.optionChain);
|
||||
},
|
||||
child: Container(
|
||||
width: 145,
|
||||
height: 40,
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFF0093FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(5)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/option_chain_icon.svg"),
|
||||
const Gap(5),
|
||||
text12W600("Option Chain"),
|
||||
],
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(8),
|
||||
|
||||
Reference in New Issue
Block a user