deep linking and option chain fixes

This commit is contained in:
kishan06
2024-06-09 14:37:53 +05:30
parent 2a4d8922c6
commit 563ab9eea2
7 changed files with 174 additions and 115 deletions

View File

@@ -6,7 +6,6 @@
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission <uses-permission
android:name="android.permission.USE_BIOMETRIC"/> android:name="android.permission.USE_BIOMETRIC"/>
<application <application

View File

@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSFaceIDUsageDescription</key> <key>NSFaceIDUsageDescription</key>
<string>Why is my app authenticating using face id?</string> <string>for authentication</string>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
@@ -11,7 +11,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>com.app.traderscircuit</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>

View File

@@ -89,6 +89,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
super.initState(); super.initState();
Utils.getStoragePermission(); Utils.getStoragePermission();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
FlutterBranchSdk.init().then((value) => listenDynamicLinks());
connectivity = Connectivity(); connectivity = Connectivity();
checkInternet(); checkInternet();
@@ -109,11 +110,10 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
}); });
} }
}); });
// print(_connectionStatus);
} }
void listenDynamicLinks() async { void listenDynamicLinks() async {
streamSubscription = FlutterBranchSdk.initSession().listen((data) { streamSubscription = FlutterBranchSdk.listSession().listen((data) {
print('listenDynamicLinks - DeepLink Data: $data'); print('listenDynamicLinks - DeepLink Data: $data');
controllerData.sink.add((data.toString())); controllerData.sink.add((data.toString()));
if (data.containsKey('+clicked_branch_link') && if (data.containsKey('+clicked_branch_link') &&
@@ -174,7 +174,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
fontFamily: 'hiragino', fontFamily: 'hiragino',
), ),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
initialRoute: RouteName.splashScreen, initialRoute: RouteName.optionChain,
getPages: AppRoutes.appRoutes(), getPages: AppRoutes.appRoutes(),
), ),
designSize: const Size(390, 844), designSize: const Size(390, 844),

View File

@@ -71,7 +71,6 @@ class _HomeScreenState extends State<HomeScreen> {
String calculatePercentageChange(double openPrice, double currentPrice) { String calculatePercentageChange(double openPrice, double currentPrice) {
final percentageChange = ((currentPrice - openPrice) / openPrice) * 100; final percentageChange = ((currentPrice - openPrice) / openPrice) * 100;
log(percentageChange.toStringAsFixed(2));
return percentageChange.toStringAsFixed(2); return percentageChange.toStringAsFixed(2);
} }
@@ -718,7 +717,6 @@ Widget cardcallWidget(
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
log("RUNNING");
Get.to(const ExploreUnseen()); Get.to(const ExploreUnseen());
}, },
child: Container( child: Container(

View File

@@ -1,8 +1,6 @@
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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:get/get.dart' hide FormData;
import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart'; import 'package:traderscircuit/Utils/Common/comonGlassmorphicContainer.dart';
import 'package:traderscircuit/Utils/Common/sized_box.dart'; import 'package:traderscircuit/Utils/Common/sized_box.dart';
@@ -19,7 +17,6 @@ class OptionChainScreen extends StatefulWidget {
} }
class _OptionChainScreenState extends State<OptionChainScreen> { class _OptionChainScreenState extends State<OptionChainScreen> {
Color _indicatorColor = Color(0xff00C236);
List<String> containerTexts = [ List<String> containerTexts = [
"9 MAY", "9 MAY",
"10 MAY", "10 MAY",
@@ -35,6 +32,7 @@ class _OptionChainScreenState extends State<OptionChainScreen> {
drawerEnableOpenDragGesture: false, drawerEnableOpenDragGesture: false,
extendBody: true, extendBody: true,
appBar: const CommonAppbar( appBar: const CommonAppbar(
height: 50,
titleTxt: "", titleTxt: "",
), ),
body: Stack( body: Stack(
@@ -54,7 +52,6 @@ class _OptionChainScreenState extends State<OptionChainScreen> {
SizedBox( SizedBox(
height: 60, height: 60,
width: double.infinity, width: double.infinity,
// color: Colors.amber,
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@@ -73,47 +70,122 @@ class _OptionChainScreenState extends State<OptionChainScreen> {
); );
}), }),
), ),
Table( Container(
border: TableBorder.symmetric( decoration: BoxDecoration(
outside: BorderSide( borderRadius: BorderRadius.circular(6),
border: Border.all(
width: 1, width: 1,
color: Color(0xFF4A73FB).withOpacity(0.3), color: const Color(0xFF4A73FB).withOpacity(0.3),
), ),
), ),
columnWidths: { child: Column(
0: FlexColumnWidth(1), children: [
1: FlexColumnWidth(1), Padding(
2: FlexColumnWidth(2), padding: const EdgeInsets.symmetric(
3: FlexColumnWidth(1), vertical: 5, horizontal: 10),
4: FlexColumnWidth(1), child: Row(
}, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
TableRow( tableMainHeader('Calls'),
decoration: BoxDecoration(color: Colors.transparent), tableMainHeader('Option Chain'),
children: [ tableMainHeader('Puts'),
tableMainHeader('Calls'), ],
tableMainHeader(''), ),
tableMainHeader('Option Chain'), ),
tableMainHeader(''), Container(
tableMainHeader('Puts'), decoration: BoxDecoration(
], color: const Color(0xff00295C),
), border: Border(
TableRow( top: BorderSide(
decoration: BoxDecoration(color: Color(0xff00295C)), width: 1,
children: [ color: const Color(0xFF4A73FB)
tableHeader('OI', 'change'), .withOpacity(0.3),
tableHeader('LTP', 'change'), ),
tableHeader('Price', ''), )),
tableHeader('LTP', 'change'), child: Row(
tableHeader('OI', 'change'), children: [
], Expanded(child: tableHeader('OI', 'change')),
), Expanded(child: tableHeader('LTP', 'change')),
...List.generate( Expanded(
15, flex: 2, child: tableHeader('Price', '')),
(index) => tableRow(index), Expanded(child: tableHeader('LTP', 'change')),
), Expanded(child: tableHeader('OI', 'change')),
], ],
) ),
),
Stack(
children: [
SizedBox(
height:
MediaQuery.of(context).size.height - 330,
child: SingleChildScrollView(
child: Table(
border: TableBorder(
horizontalInside: BorderSide(
width: 1,
color: const Color(0xFF4A73FB)
.withOpacity(0.3),
),
),
columnWidths: const {
0: FlexColumnWidth(1),
1: FlexColumnWidth(1),
2: FlexColumnWidth(2),
3: FlexColumnWidth(1),
4: FlexColumnWidth(1),
},
children: [
...List.generate(
15,
(index) => tableRow(index),
),
],
),
),
),
Positioned(
left: 0,
right: 0,
top: 200, // Adjust the position as needed
child: Row(
children: [
Expanded(
child: CustomPaint(
painter: DottedLinePainter(
color: Color(0xFF4A73FB)),
child: Container(
height: 1,
),
),
),
Container(
width: 80, // Adjust width as needed
height: 30,
color: const Color(0xff00295C),
alignment: Alignment.center,
child: Text('22,851.75',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.sp)),
),
Expanded(
child: CustomPaint(
painter: DottedLinePainter(
color: Color(0xFF4A73FB)),
child: Container(
height: 1,
),
),
),
],
),
),
],
),
],
),
),
], ],
), ),
), ),
@@ -148,7 +220,7 @@ class _OptionChainScreenState extends State<OptionChainScreen> {
Widget tableMainHeader(String text) { Widget tableMainHeader(String text) {
return Center( return Center(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 127.0), padding: const EdgeInsets.symmetric(vertical: 10.0),
child: Text(text, child: Text(text,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@@ -164,11 +236,11 @@ class _OptionChainScreenState extends State<OptionChainScreen> {
color: index % 2 == 0 ? Colors.transparent : Colors.transparent, color: index % 2 == 0 ? Colors.transparent : Colors.transparent,
), ),
children: [ children: [
tableCell('1,43,875', '\n59,625'), tableCell('0.3', ''),
tableCell('271.00', '\n-45.65'), tableCell('271.00', ''),
tableCell('22,250', ''), tableCell('22,250', ''),
tableCell('41.35', '\n-8.20'), tableCell('41.35', ''),
tableCell('10,07,275', '\n2,71,400'), tableCell('0.3', ''),
], ],
); );
} }
@@ -235,7 +307,7 @@ class OptionChainTable extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Table( Table(
columnWidths: { columnWidths: const {
0: FlexColumnWidth(1), 0: FlexColumnWidth(1),
1: FlexColumnWidth(1), 1: FlexColumnWidth(1),
2: FlexColumnWidth(1), 2: FlexColumnWidth(1),
@@ -246,7 +318,7 @@ class OptionChainTable extends StatelessWidget {
// border: TableBorder.all(color: Colors.white), // border: TableBorder.all(color: Colors.white),
children: [ children: [
TableRow( TableRow(
decoration: BoxDecoration(color: Colors.black), decoration: const BoxDecoration(color: Colors.black),
children: [ children: [
tableHeader('OI\nchange'), tableHeader('OI\nchange'),
tableHeader('LTP\nchange'), tableHeader('LTP\nchange'),
@@ -269,7 +341,8 @@ class OptionChainTable extends StatelessWidget {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Text(text, child: Text(text,
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), style: const TextStyle(
color: Colors.white, fontWeight: FontWeight.bold)),
), ),
); );
} }
@@ -295,8 +368,37 @@ class OptionChainTable extends StatelessWidget {
return Padding( return Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Text(text, style: TextStyle(color: Colors.white)), child: Text(text, style: const TextStyle(color: Colors.white)),
), ),
); );
} }
} }
class DottedLinePainter extends CustomPainter {
final Color color;
DottedLinePainter({required this.color});
@override
void paint(Canvas canvas, Size size) {
var paint = Paint()
..color = color
..strokeWidth = 1
..style = PaintingStyle.stroke;
var max = size.width;
var dashWidth = 5;
var dashSpace = 3;
double startX = 0;
while (startX < max) {
canvas.drawLine(Offset(startX, 0), Offset(startX + dashWidth, 0), paint);
startX += dashWidth + dashSpace;
}
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return false;
}
}

View File

@@ -357,10 +357,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: firebase_core_web name: firebase_core_web
sha256: "22fcb352744908224fc7be3caae254836099786acfe5df6e9fe901e9c2575a41" sha256: c8e1d59385eee98de63c92f961d2a7062c5d9a65e7f45bdc7f1b0b205aab2492
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.17.1" version: "2.11.5"
firebase_crashlytics: firebase_crashlytics:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -728,30 +728,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.4.9" version: "0.4.9"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
version: "2.0.1"
lints: lints:
dependency: transitive dependency: transitive
description: description:
@@ -828,26 +804,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16+1" version: "0.12.16"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.8.0" version: "0.5.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.0" version: "1.10.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@@ -892,10 +868,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.0" version: "1.8.3"
path_drawing: path_drawing:
dependency: transitive dependency: transitive
description: description:
@@ -1470,14 +1446,6 @@ packages:
url: "https://github.com/kishan06/videoPlayerKB.git" url: "https://github.com/kishan06/videoPlayerKB.git"
source: git source: git
version: "0.0.2" version: "0.0.2"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev"
source: hosted
version: "13.0.0"
wakelock: wakelock:
dependency: transitive dependency: transitive
description: description:
@@ -1522,26 +1490,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.1" version: "0.3.0"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "24301d8c293ce6fe327ffe6f59d8fd8834735f0ec36e4fd383ec7ff8a64aa078"
url: "https://pub.dev"
source: hosted
version: "0.1.5"
web_socket_channel: web_socket_channel:
dependency: "direct main" dependency: "direct main"
description: description:
name: web_socket_channel name: web_socket_channel
sha256: a2d56211ee4d35d9b344d9d4ce60f362e4f5d1aafb988302906bd732bc731276 sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.0" version: "2.4.0"
win32: win32:
dependency: transitive dependency: transitive
description: description:
@@ -1567,5 +1527,5 @@ packages:
source: hosted source: hosted
version: "6.3.0" version: "6.3.0"
sdks: sdks:
dart: ">=3.3.0 <4.0.0" dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0" flutter: ">=3.16.0"

View File

@@ -62,7 +62,7 @@ dependencies:
flutter_inappwebview: ^6.0.0 flutter_inappwebview: ^6.0.0
flutter_branch_sdk: ^7.1.0 flutter_branch_sdk: ^7.1.0
socket_io_client: ^2.0.3+1 socket_io_client: ^2.0.3+1
web_socket_channel: ^3.0.0 web_socket_channel:
dev_dependencies: dev_dependencies: