diff --git a/.run/main.dart.run.xml b/.run/main.dart.run.xml
index 4a58a7c9..4767aff8 100644
--- a/.run/main.dart.run.xml
+++ b/.run/main.dart.run.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/assets/app_tour/right_down.png b/assets/app_tour/right_down.png
new file mode 100644
index 00000000..324c148c
Binary files /dev/null and b/assets/app_tour/right_down.png differ
diff --git a/lib/config/my_router.dart b/lib/config/my_router.dart
index b4ef5ea0..e6b1a5fa 100644
--- a/lib/config/my_router.dart
+++ b/lib/config/my_router.dart
@@ -316,6 +316,7 @@ import '../presentation/Screens/demo_home.dart';
import '../presentation/Screens/profilepage.dart';
import '../presentation/routes/auth_routes/login_route.dart';
import '../presentation/routes/bottom_bar_routes/tab_routes/home_route.dart';
+import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/bookmark.dart';
import '../presentation/routes/drawer_routes/Drawer Items/edit_profile.dart';
import '../presentation/routes/drawer_routes/Drawer Items/feedback.dart';
import '../presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart';
@@ -471,6 +472,10 @@ final GoRouter router = GoRouter(
path: '/editProfile',
builder: (context, state) => EditProfile(),
),
+ GoRoute(
+ path: '/bookmark',
+ builder: (context, state) => BookMark(),
+ ),
GoRoute(
path: '/manageuser',
builder: (context, state) => ManageUserRouter(),
diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb
index fc0ec46f..addb66f5 100644
--- a/lib/l10n/intl_en.arb
+++ b/lib/l10n/intl_en.arb
@@ -92,6 +92,6 @@
"economy": "Access detailed statistics and drill-down pages for KPIs in the Economy category to uncover key trends and metrics.",
"bookMark": "Bookmark important KPIs or datasets for quick and easy access anytime through the Bookmarks section.",
"toggle": "Switch between English and Arabic using the language toggle at the top-right corner for a bilingual experience.",
- "tour_navBar": "Use the navigation bar to quickly access Profile, Feedback, User Guide, Notifications, and other key app features.",
- "mainMenu": "Access dedicated pages and additional features by selecting options from the Main Menu."
+ "tour_navBar": "Access dedicated pages and additional features by selecting options from the Main Menu.",
+ "mainMenu": "Use the navigation bar to quickly access Profile, Feedback, User Guide, Notifications, and other key app features."
}
diff --git a/lib/presentation/Screens/charts/screens/chart_screen.dart b/lib/presentation/Screens/charts/screens/chart_screen.dart
index 87d07f82..fdd621f0 100644
--- a/lib/presentation/Screens/charts/screens/chart_screen.dart
+++ b/lib/presentation/Screens/charts/screens/chart_screen.dart
@@ -2,13 +2,16 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
+import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';
import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/uae_numbers_asset_path.dart';
import 'package:uae_stat/presentation/Screens/charts/services/api_service.dart';
import 'package:uae_stat/presentation/Screens/charts/widgets/chart_widget.dart';
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
import 'package:uae_stat/presentation/components/my_toggle.dart';
+import 'package:flutter_gen/gen_l10n/app_localizations.dart';
+import 'package:uae_stat/presentation/Screens/app_tour/Target_content.dart';
import '../filters/search_filter_helper.dart';
class ChartScreen1 extends ConsumerStatefulWidget {
@@ -52,6 +55,12 @@ class _ChartScreen1State extends ConsumerState {
int _activeTabIndex = 0;
dynamic _tabsData = [];
+ late List marriageTargets;
+ late List previousMarriageTargets;
+ late TutorialCoachMark tutorialCoachMark;
+ final GlobalKey chartKey = GlobalKey();
+ final GlobalKey bookMarkKey = GlobalKey();
+ final GlobalKey cardKey= GlobalKey();
@override
void initState() {
@@ -66,6 +75,715 @@ class _ChartScreen1State extends ConsumerState {
onTabSelected(_tabsData[0]['id']);
}
});
+
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ _startTutorialAfterRender();
+ });
+ }
+
+ void handleSkip() {
+ tutorialCoachMark.skip();
+ debugPrint('Skip clicked');
+ ref.read(chartsTourProvider.notifier).state = true;
+ ref.read(previousChartsTourProvider.notifier).state = true;
+ ref.read(homeTourProvider.notifier).state = true;
+ ref.read( previousHomeTourProvider.notifier).state = true;
+ ref.read(scaffoldTourProvider.notifier).state = true;
+ ref.read(previousScaffoldTourProvider.notifier).state = true;
+ context.go('/myhomepage');
+ }
+
+ void _kpiTutorialCoachMark() {
+ debugPrint('Not Initialized and Started');
+ // _calculateMarkPosition();
+ _initmarriageTargets();
+ debugPrint('Initialized and Started');
+ tutorialCoachMark = TutorialCoachMark(
+ paddingFocus: 0,
+ useSafeArea: true,
+
+ pulseEnable: false,
+ hideSkip: true,
+ targets: marriageTargets,
+ onFinish: () {
+ context.go('/myhomepage');
+ debugPrint('Marriage Tutorial Finished');
+ },
+
+ )..show(context: context);
+ }
+
+
+ void _startTutorialAfterRender() {
+ final chartTour = ref.watch(chartsTourProvider);
+ final previousChartTour = ref.watch(previousChartsTourProvider);
+ debugPrint('render problem');
+ if (cardKey.currentContext != null && !chartTour) {
+ _kpiTutorialCoachMark();
+ } else if(cardKey.currentContext != null && !previousChartTour) {
+ _previousKpiTutorial();
+ }
+ else if (!chartTour || !previousChartTour){
+ Future.delayed(Duration(milliseconds: 100), _startTutorialAfterRender);
+ }else{
+ return;
+ }
+
+ }
+
+ void _previousKpiTutorial() {
+ _initpreviousTargets();
+ tutorialCoachMark = TutorialCoachMark(
+ paddingFocus: 0,
+ useSafeArea: true,
+ pulseEnable: false,
+ hideSkip: true,
+ targets: previousMarriageTargets,
+ onFinish: () {
+ context.go('/myhomepage');
+ debugPrint('Previous Marriage Tutorial Finished');
+ },
+
+ )..show(context: context);
+
+ }
+ void _initmarriageTargets(){
+ final double screenWidth= MediaQuery.of(context).size.width;
+ final double screenHeight= MediaQuery.of(context).size.height;
+ marriageTargets=[
+ TargetFocus(
+ identify: 'cardKey',
+ keyTarget: cardKey,
+ shape: ShapeLightFocus.RRect,
+ radius: 8,
+ paddingFocus: 0,
+ contents: [
+ createTargetContent(
+ text: AppLocalizations.of(context)!.kpiCards,
+ alignment: ContentAlign.top,
+ gap:55,
+ space: 0,
+ ),
+ TargetContent(
+ align: ContentAlign.bottom,
+ child: SizedBox(
+ width: double.infinity,
+ height: MediaQuery.of(context).size.height*0.3,
+ child: Stack(
+ children: [
+ Positioned(
+ bottom: 55,
+ left: 16,
+ right: 16,
+ child: Column(
+ children: [
+ Align(
+ alignment: Alignment.bottomRight,
+ child:Padding(
+ padding: EdgeInsets.only(right:10),
+ child:Text(
+ '3/7',
+ style: const TextStyle(
+ color: Colors.white,
+ fontSize: 14,
+ ),
+ ) ,
+ ),
+ ),
+ const SizedBox(height: 5),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ ElevatedButton(
+ onPressed: () => handleSkip(),
+ style: ElevatedButton.styleFrom(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ side: const BorderSide(color: Colors.white),
+ backgroundColor: Colors.transparent,
+ elevation: 0,
+ ),
+ child: const Text(
+ 'Skip',
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 14,
+ ),
+ ),
+ ),
+ Row(
+ children: [
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(color: Colors.white, width: 2.0),
+ ),
+ child: IconButton(
+ iconSize: 20,
+ icon: const Icon(Icons.arrow_back, color: Colors.white),
+ onPressed: () {
+ ref.read(chartsTourProvider.notifier).state=true;
+ ref.read(previousHomeTourProvider.notifier).state=false;
+ tutorialCoachMark.finish();
+ },
+ ),
+ ),
+ const SizedBox(width: 10),
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: Color(0xFF7DAFBC),
+ border: Border.all(color:Color(0xFF7DAFBC), width: 1.5),
+ ),
+ child: IconButton(
+ iconSize: 20,
+ icon: const Icon(Icons.arrow_forward, color: Colors.white),
+ onPressed: () {
+ tutorialCoachMark.next();
+ },
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ TargetContent(
+ padding: EdgeInsets.only(bottom: 0,top : 0,),
+ align: ContentAlign.top,
+ child: SizedBox(
+ width: MediaQuery.of(context).size.width,
+ height:MediaQuery.of(context).size.height*0.69 ,
+ child: Stack(
+ children: [
+ Positioned(
+ left: MediaQuery.of(context).size.width*0.40,
+ bottom: 0,
+ child: Image.asset(
+ 'assets/app_tour/leftUp.png',
+ width: 100,
+ height: 90,
+ ),
+ ),
+ ]
+ ),
+
+ ),
+ ),
+ ],
+ ),
+ // TargetFocus(
+ // identify: 'chartKey',
+ // keyTarget: chartKey,
+ // shape: ShapeLightFocus.RRect,
+ // paddingFocus: 0,
+ // contents: [
+ // createTargetContent(
+ // text: AppLocalizations.of(context)!.kpiCards,
+ // alignment: ContentAlign.top,
+ // gap:0,
+ // space: 0,
+ // ),
+ // TargetContent(
+ // align: ContentAlign.bottom,
+ // child: SizedBox(
+ // width: double.infinity,
+ // height: MediaQuery.of(context).size.height *
+ // 0.30, // Set an appropriate height for the Stack
+ // child: Stack(
+ // children: [
+ // Positioned(
+ // bottom: 25,
+ // left: 16,
+ // right: 16,
+ // child: Row(
+ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ // children: [
+ // ElevatedButton(
+ // onPressed: () => handleSkip(),
+ // style: ElevatedButton.styleFrom(
+ // shape: RoundedRectangleBorder(
+ // borderRadius: BorderRadius.circular(12),
+ // ),
+ // side: const BorderSide(color: Colors.white),
+ // backgroundColor: Colors.transparent,
+ // elevation: 0,
+ // ),
+ // child: const Text(
+ // 'Skip',
+ // style: TextStyle(
+ // color: Colors.white,
+ // fontSize: 14,
+ // ),
+ // ),
+ // ),
+ // Column(
+ // children: [
+ // Text(
+ // '5/7',
+ // style: const TextStyle(
+ // color: Colors.white,
+ // fontSize: 14,
+ // ),
+ // ),
+ // const SizedBox(height: 3),
+ // Row(
+ // children: [
+ // Container(
+ // decoration: BoxDecoration(
+ // shape: BoxShape.circle,
+ // border: Border.all(
+ // color: Colors.white, width: 2.0),
+ // ),
+ // child: IconButton(
+ // icon: const Icon(Icons.arrow_back,
+ // color: Colors.white),
+ // onPressed: () {
+ // scrollToTargetThenShowTutorial(bookMarkKey);
+ // tutorialCoachMark.next();
+ // },
+ // ),
+ // ),
+ // const SizedBox(width: 10),
+ // Container(
+ // decoration: BoxDecoration(
+ // shape: BoxShape.circle,
+ // color: Color(0xFF7DAFBC),
+ // border: Border.all(
+ // color: Color(0xFF7DAFBC), width: 1.5),
+ // ),
+ // child: IconButton(
+ // icon: const Icon(Icons.arrow_forward,
+ // color: Colors.white),
+ // onPressed: () {
+ // tutorialCoachMark.next();
+ // },
+ // ),
+ // ),
+ // ],
+ // ),
+ // ],
+ // ),
+ // ],
+ // ),
+ // ),
+ // ],
+ // ),
+ // ),
+ // ),
+ // ],
+ // ),
+ TargetFocus(
+ identify: 'BookMarkKey',
+ keyTarget: bookMarkKey,
+ shape: ShapeLightFocus.RRect,
+ radius: 8,
+ paddingFocus: 12,
+ contents: [
+ createTargetContent(
+ text: AppLocalizations.of(context)!.bookMark,
+ alignment: ContentAlign.bottom,
+ gap: 53,
+ space: 50,
+ ),
+ TargetContent(
+ align: ContentAlign.bottom,
+ child: SizedBox(
+ width: double.infinity,
+ height: MediaQuery.of(context).size.height*0.60,
+ child: Stack(
+ children: [
+ Positioned(
+ bottom: 55,
+ left: 16,
+ right: 16,
+ child: Column(
+ children: [
+ Align(
+ alignment: Alignment.bottomRight,
+ child: Padding(padding: EdgeInsets.only(right: 10),
+ child: Text(
+ '4/7',
+ style: const TextStyle(
+ color: Colors.white,
+ fontSize: 14,
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(height: 5),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ ElevatedButton(
+ onPressed: () => handleSkip(),
+ style: ElevatedButton.styleFrom(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ side: const BorderSide(color: Colors.white),
+ backgroundColor: Colors.transparent,
+ elevation: 0,
+ ),
+ child: const Text(
+ 'Skip',
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 14,
+ ),
+ ),
+ ),
+ Row(
+ children: [
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(color: Colors.white, width: 2.0),
+ ),
+ child: IconButton(
+ iconSize: 20,
+ icon: const Icon(Icons.arrow_back, color: Colors.white),
+ onPressed: () {
+ tutorialCoachMark.previous();
+ },
+ ),
+ ),
+ const SizedBox(width: 10),
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: Color(0xFF7DAFBC),
+ border: Border.all(color: Color(0xFF7DAFBC), width: 1),
+ ),
+ child: IconButton(
+ iconSize: 20,
+ icon: const Icon(Icons.arrow_forward, color: Colors.white),
+ onPressed: () {
+ ref.read(chartsTourProvider.notifier).state=true;
+ ref.read(scaffoldTourProvider.notifier).state=false;
+ tutorialCoachMark.finish();
+ },
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ TargetContent(
+ padding: EdgeInsets.only(left:0, top:0),
+ align: ContentAlign.right,
+ child: Container(
+ width: screenWidth/4,
+ height: screenHeight,
+ child: Stack(
+ children: [
+ Image.asset(
+ 'assets/app_tour/leftDown.png',
+ fit: BoxFit.contain,
+ ),
+ // Positioned(
+ // top: 0,
+ // left: MediaQuery.of(context).size.width* 0.5,
+ // child: SizedBox(
+ // width: 50,
+ // height: 100,
+ // child: Image.asset(
+ // 'assets/app_tour/bookmark2.png',
+ // fit: BoxFit.contain,
+ // ),
+ // ),
+ // ),
+ ],
+ ),
+ ),
+ ),
+ ],
+ ),
+
+ ];
+ }
+
+ void _initpreviousTargets(){
+ final double screenWidth= MediaQuery.of(context).size.width;
+ final double screenHeight= MediaQuery.of(context).size.height;
+ previousMarriageTargets=[
+ TargetFocus(
+ identify: 'BookMarkKey',
+ keyTarget: bookMarkKey,
+ shape: ShapeLightFocus.RRect,
+ radius: 8,
+ paddingFocus: 12,
+ contents: [
+ createTargetContent(
+ text: AppLocalizations.of(context)!.bookMark,
+ space: 50,
+ alignment: ContentAlign.bottom,
+ gap: 23,
+ ),
+ TargetContent(
+ align: ContentAlign.bottom,
+ child: SizedBox(
+ width: double.infinity,
+ height: MediaQuery.of(context).size.height*0.60,
+ child: Stack(
+ children: [
+ Positioned(
+ bottom: 35,
+ left: 16,
+ right: 16,
+ child: Column(
+ children: [
+ Align(
+ alignment: Alignment.bottomRight,
+ child:Padding(
+ padding: const EdgeInsets.only(right: 10.0),
+ child: Text(
+ '4/7',
+ style: const TextStyle(
+ color: Colors.white,
+ fontSize: 14,
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(height: 5),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ ElevatedButton(
+ onPressed: () => handleSkip(),
+ style: ElevatedButton.styleFrom(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ side: const BorderSide(color: Colors.white),
+ backgroundColor: Colors.transparent,
+ elevation: 0,
+ ),
+ child: const Text(
+ 'Skip',
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 14,
+ ),
+ ),
+ ),
+ Row(
+ children: [
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(color: Colors.white, width: 2.0),
+ ),
+ child: IconButton(
+ iconSize: 20,
+ icon: const Icon(Icons.arrow_back, color: Colors.white),
+ onPressed: () {
+ tutorialCoachMark.next();
+ },
+ ),
+ ),
+ const SizedBox(width: 10),
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: Color(0xFF7DAFBC),
+ border: Border.all(color:Color(0xFF7DAFBC), width: 1.5),
+ ),
+ child: IconButton(
+ iconSize: 20,
+ icon: const Icon(Icons.arrow_forward, color: Colors.white),
+ onPressed: () {
+ ref.read(chartsTourProvider.notifier).state=true;
+ ref.read(scaffoldTourProvider.notifier).state=false;
+ tutorialCoachMark.finish();
+ },
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ TargetContent(
+ padding: EdgeInsets.only(left:0, top: 10),
+ align: ContentAlign.right,
+ child: Container(
+ width: screenWidth/4,
+ height: screenHeight,
+ child: Stack(
+ children: [
+ Image.asset(
+ 'assets/app_tour/leftDown.png',
+ fit: BoxFit.contain,
+ ),
+ // Positioned(
+ // top: 0,
+ // left: MediaQuery.of(context).size.width* 0.5,
+ // child: SizedBox(
+ // width: 50,
+ // height: 100,
+ // child: Image.asset(
+ // 'assets/app_tour/bookmark2.png',
+ // fit: BoxFit.contain,
+ // ),
+ // ),
+ // ),
+ ],
+ ),
+ ),
+ ),
+ ],
+ ),
+ TargetFocus(
+ identify: 'cardKey',
+ keyTarget: cardKey,
+ shape: ShapeLightFocus.RRect,
+ radius: 8,
+ paddingFocus: 0,
+ contents: [
+ createTargetContent(
+ text: AppLocalizations.of(context)!.kpiCards,
+ space: 0,
+ alignment: ContentAlign.top,
+ gap:50,
+ ),
+ TargetContent(
+ align: ContentAlign.bottom,
+ child: SizedBox(
+ width: double.infinity,
+ height: MediaQuery.of(context).size.height*0.30,
+ child: Stack(
+ children: [
+ Positioned(
+ bottom: 55,
+ left: 16,
+ right: 16,
+ child: Column(
+ children: [
+ Align(alignment: Alignment.bottomRight,
+ child:Padding(
+ padding: const EdgeInsets.only(right:10.0),
+ child: Text(
+ '3/7',
+ style: const TextStyle(
+ color: Colors.white,
+ fontSize: 14,
+ ),
+ ),
+ ),),
+ const SizedBox(height: 5),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ ElevatedButton(
+ onPressed: () => handleSkip(),
+ style: ElevatedButton.styleFrom(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ side: const BorderSide(color: Colors.white),
+ backgroundColor: Colors.transparent,
+ elevation: 0,
+ ),
+ child: const Text(
+ 'Skip',
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 14,
+ ),
+ ),
+ ),
+ Row(
+ children: [
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(color: Colors.white, width: 2.0),
+ ),
+ child: IconButton(
+ iconSize: 20,
+ icon: const Icon(Icons.arrow_back, color: Colors.white),
+ onPressed: () {
+ ref.read(previousChartsTourProvider.notifier).state=true;
+ ref.read(previousHomeTourProvider.notifier).state=false;
+ tutorialCoachMark.finish();
+ },
+ ),
+ ),
+ const SizedBox(width: 10),
+ Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: Color(0xFF7DAFBC),
+ border: Border.all(color:Color(0xFF7DAFBC), width: 1.5),
+ ),
+ child: IconButton(
+ iconSize: 20,
+ icon: const Icon(Icons.arrow_forward, color: Colors.white),
+ onPressed: () {
+ tutorialCoachMark.previous();
+ },
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ TargetContent(
+ padding: EdgeInsets.only(bottom: 0,top : 0,),
+ align: ContentAlign.top,
+ child: SizedBox(
+ width: MediaQuery.of(context).size.width,
+ height:MediaQuery.of(context).size.height*0.69 ,
+ child: Stack(
+ children: [
+ Positioned(
+ left: MediaQuery.of(context).size.width*0.40,
+ bottom: 0,
+ child: Image.asset(
+ 'assets/app_tour/leftUp.png',
+ width: 100,
+ height: 90,
+ ),
+ ),
+ ]
+ ),
+
+ ),
+ ),
+ ],
+ ),
+
+
+ ];
}
void _scrollToIndex(int index) {
@@ -870,6 +1588,7 @@ class _ChartScreen1State extends ConsumerState {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Row(
+ key: bookMarkKey,
children: [
Text(
context.translate(
@@ -975,6 +1694,7 @@ class _ChartScreen1State extends ConsumerState {
Padding(
padding: const EdgeInsets.all(3.34),
child: GridView.builder(
+ key:cardKey,
itemCount: cardData.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
diff --git a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart
index 176146f2..d05843ae 100644
--- a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart
+++ b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart
@@ -207,7 +207,7 @@ class EconomyStatsWidget extends ConsumerStatefulWidget {
class EconomyStatsState extends ConsumerState {
List data = [];
- final _pb = PocketBase('https://pb.venbait.in');
+final _pb = PocketBase('https://pb.venbait.in');
bool isLoading = true;
final GlobalKey cardTopicKey = GlobalKey();
@@ -215,12 +215,11 @@ class EconomyStatsState extends ConsumerState {
late TutorialCoachMark tutorialCoachMark;
late List homeTargets;
late List previousHomeTargets;
- Offset _imageCardPosition = Offset.zero;
- Offset _imageTopicPosition = Offset.zero;
+ Offset _imageCardPosition =Offset.zero;
+ Offset _imageTopicPosition =Offset.zero;
void _calculateCardPosition() {
- final RenderBox cardRenderBox =
- cardsKey.currentContext!.findRenderObject() as RenderBox;
+ final RenderBox cardRenderBox = cardsKey.currentContext!.findRenderObject() as RenderBox;
final Offset cardPosition = cardRenderBox.localToGlobal(Offset.zero);
final Size cardSize = cardRenderBox.size;
@@ -236,10 +235,10 @@ class EconomyStatsState extends ConsumerState {
void handleSkip() {
tutorialCoachMark.skip();
debugPrint('Skip clicked');
- ref.read(chartsTourProvider.notifier).state = true;
- ref.read(previousChartsTourProvider.notifier).state = true;
- ref.read(homeTourProvider.notifier).state = true;
- ref.read(previousHomeTourProvider.notifier).state = true;
+ ref.read(chartsTourProvider.notifier).state = true;
+ ref.read(previousChartsTourProvider.notifier).state = true;
+ ref.read(homeTourProvider.notifier).state = true;
+ ref.read( previousHomeTourProvider.notifier).state = true;
ref.read(scaffoldTourProvider.notifier).state = true;
ref.read(previousScaffoldTourProvider.notifier).state = true;
}
@@ -291,10 +290,11 @@ class EconomyStatsState extends ConsumerState {
},
)..show(context: context);
}
+
}
- void _initTarget() {
- homeTargets = [
+ void _initTarget(){
+ homeTargets=[
TargetFocus(
identify: 'cardTopicKey',
keyTarget: cardTopicKey,
@@ -310,7 +310,7 @@ class EconomyStatsState extends ConsumerState {
align: ContentAlign.bottom,
child: SizedBox(
width: double.infinity,
- height: MediaQuery.of(context).size.height * 0.69,
+ height: MediaQuery.of(context).size.height*0.69,
child: Stack(
children: [
Positioned(
@@ -355,14 +355,12 @@ class EconomyStatsState extends ConsumerState {
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFF7DAFBC),
- border: Border.all(
- color: Color(0xFF7DAFBC), width: 1),
+ border: Border.all(color: Color(0xFF7DAFBC), width: 1),
),
child: IconButton(
padding: EdgeInsets.zero,
iconSize: 20,
- icon: const Icon(Icons.arrow_forward,
- color: Colors.white),
+ icon: const Icon(Icons.arrow_forward, color: Colors.white),
onPressed: () {
tutorialCoachMark.next();
},
@@ -383,18 +381,21 @@ class EconomyStatsState extends ConsumerState {
align: ContentAlign.bottom,
child: SizedBox(
width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height * 0.69,
- child: Stack(children: [
- Positioned(
- left: MediaQuery.of(context).size.width * 0.4,
- top: _imageCardPosition.dy - 29,
- child: Image.asset(
- 'assets/app_tour/down_right.png',
- width: 40,
- height: 90,
- ),
- ),
- ]),
+ height:MediaQuery.of(context).size.height*0.69 ,
+ child: Stack(
+ children: [
+ Positioned(
+ left: MediaQuery.of(context).size.width*0.4,
+ top: _imageCardPosition.dy-29,
+ child: Image.asset(
+ 'assets/app_tour/down_right.png',
+ width: 40,
+ height: 90,
+ ),
+ ),
+ ]
+ ),
+
),
),
],
@@ -405,17 +406,17 @@ class EconomyStatsState extends ConsumerState {
shape: ShapeLightFocus.RRect,
contents: [
createTargetContent(
- text: AppLocalizations.of(context)!.economy,
+ text:AppLocalizations.of(context)!.economy,
alignment: ContentAlign.bottom,
gap: 0,
- space: 40,
- ),
+ space: 40,),
+
TargetContent(
align: ContentAlign.bottom,
- child: SizedBox(
+ child:
+ SizedBox(
width: double.infinity,
- height: MediaQuery.of(context).size.height *
- 0.5, // Set an appropriate height for the Stack
+ height: MediaQuery.of(context).size.height *0.5, // Set an appropriate height for the Stack
child: Stack(
children: [
Positioned(
@@ -426,7 +427,7 @@ class EconomyStatsState extends ConsumerState {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
- onPressed: () => handleSkip,
+ onPressed: () =>handleSkip,
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
@@ -458,13 +459,11 @@ class EconomyStatsState extends ConsumerState {
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
- border: Border.all(
- color: Colors.white, width: 2.0),
+ border: Border.all(color: Colors.white, width: 2.0),
),
child: IconButton(
iconSize: 20,
- icon: const Icon(Icons.arrow_back,
- color: Colors.white),
+ icon: const Icon(Icons.arrow_back, color: Colors.white),
onPressed: () {
tutorialCoachMark.previous();
},
@@ -475,13 +474,11 @@ class EconomyStatsState extends ConsumerState {
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFF7DAFBC),
- border: Border.all(
- color: Color(0xFF7DAFBC), width: 1),
+ border: Border.all(color: Color(0xFF7DAFBC), width: 1),
),
child: IconButton(
iconSize: 20,
- icon: const Icon(Icons.arrow_forward,
- color: Colors.white),
+ icon: const Icon(Icons.arrow_forward, color: Colors.white),
onPressed: () {
tutorialCoachMark.next();
},
@@ -501,19 +498,22 @@ class EconomyStatsState extends ConsumerState {
TargetContent(
align: ContentAlign.bottom,
child: SizedBox(
- width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height * 0.69,
- child: Stack(children: [
- Positioned(
- left: MediaQuery.of(context).size.width * 0.40,
- top: _imageTopicPosition.dy - 29,
- child: Image.asset(
- 'assets/app_tour/down_right.png',
- width: 40,
- height: 90,
- ),
- ),
- ]),
+ width: MediaQuery.of(context).size.width ,
+ height:MediaQuery.of(context).size.height*0.69 ,
+ child: Stack(
+ children: [
+ Positioned(
+ left: MediaQuery.of(context).size.width*0.40,
+ top: _imageTopicPosition.dy-29,
+ child: Image.asset(
+ 'assets/app_tour/down_right.png',
+ width: 40,
+ height: 90,
+ ),
+ ),
+ ]
+ ),
+
),
),
],
@@ -521,25 +521,24 @@ class EconomyStatsState extends ConsumerState {
];
}
- void _initPreviousTarget() {
- previousHomeTargets = [
+ void _initPreviousTarget(){
+ previousHomeTargets=[
TargetFocus(
identify: 'cardsKey',
keyTarget: cardsKey,
shape: ShapeLightFocus.RRect,
contents: [
createTargetContent(
- text: AppLocalizations.of(context)!.economy,
+ text:AppLocalizations.of(context)!.economy,
alignment: ContentAlign.bottom,
gap: 0,
- space: 40,
- ),
+ space: 40,),
TargetContent(
align: ContentAlign.bottom,
- child: SizedBox(
+ child:
+ SizedBox(
width: double.infinity,
- height: MediaQuery.of(context).size.height *
- 0.5, // Set an appropriate height for the Stack
+ height: MediaQuery.of(context).size.height *0.5, // Set an appropriate height for the Stack
child: Stack(
children: [
Positioned(
@@ -550,7 +549,7 @@ class EconomyStatsState extends ConsumerState {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
- onPressed: () => handleSkip(),
+ onPressed: () =>handleSkip(),
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
@@ -582,12 +581,10 @@ class EconomyStatsState extends ConsumerState {
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
- border: Border.all(
- color: Colors.white, width: 2.0),
+ border: Border.all(color: Colors.white, width: 2.0),
),
child: IconButton(
- icon: const Icon(Icons.arrow_back,
- color: Colors.white),
+ icon: const Icon(Icons.arrow_back, color: Colors.white),
onPressed: () {
tutorialCoachMark.next();
},
@@ -598,21 +595,14 @@ class EconomyStatsState extends ConsumerState {
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFF7DAFBC),
- border: Border.all(
- color: Color(0xFF7DAFBC), width: 1.5),
+ border: Border.all(color: Color(0xFF7DAFBC), width: 1.5),
),
child: IconButton(
iconSize: 20,
- icon: const Icon(Icons.arrow_forward,
- color: Colors.white),
+ icon: const Icon(Icons.arrow_forward, color: Colors.white),
onPressed: () {
- ref
- .read(
- previousHomeTourProvider.notifier)
- .state = true;
- ref
- .read(chartsTourProvider.notifier)
- .state = false;
+ ref.read(previousHomeTourProvider.notifier).state=true;
+ ref.read(chartsTourProvider.notifier).state=false;
tutorialCoachMark.finish();
},
),
@@ -632,18 +622,21 @@ class EconomyStatsState extends ConsumerState {
align: ContentAlign.bottom,
child: SizedBox(
width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height * 0.69,
- child: Stack(children: [
- Positioned(
- left: MediaQuery.of(context).size.width * 0.40,
- top: _imageTopicPosition.dy - 29,
- child: Image.asset(
- 'assets/app_tour/down_right.png',
- width: 40,
- height: 90,
- ),
- ),
- ]),
+ height:MediaQuery.of(context).size.height*0.69 ,
+ child: Stack(
+ children: [
+ Positioned(
+ left: MediaQuery.of(context).size.width*0.40,
+ top: _imageTopicPosition.dy-29,
+ child: Image.asset(
+ 'assets/app_tour/down_right.png',
+ width: 40,
+ height: 90,
+ ),
+ ),
+ ]
+ ),
+
),
),
],
@@ -654,7 +647,7 @@ class EconomyStatsState extends ConsumerState {
shape: ShapeLightFocus.RRect,
contents: [
createTargetContent(
- text: AppLocalizations.of(context)!.home_topic,
+ text:AppLocalizations.of(context)!.home_topic,
alignment: ContentAlign.bottom,
gap: 45,
space: 40,
@@ -663,7 +656,7 @@ class EconomyStatsState extends ConsumerState {
align: ContentAlign.bottom,
child: SizedBox(
width: double.infinity,
- height: MediaQuery.of(context).size.height * 0.69,
+ height: MediaQuery.of(context).size.height*0.69,
child: Stack(
children: [
Positioned(
@@ -711,13 +704,11 @@ class EconomyStatsState extends ConsumerState {
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFF7DAFBC),
- border: Border.all(
- color: Color(0xFF7DAFBC), width: 1.5),
+ border: Border.all(color: Color(0xFF7DAFBC), width: 1.5),
),
child: IconButton(
iconSize: 20,
- icon: const Icon(Icons.arrow_forward,
- color: Colors.white),
+ icon: const Icon(Icons.arrow_forward, color: Colors.white),
onPressed: () {
tutorialCoachMark.previous();
},
@@ -738,18 +729,21 @@ class EconomyStatsState extends ConsumerState {
align: ContentAlign.bottom,
child: SizedBox(
width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height * 0.69,
- child: Stack(children: [
- Positioned(
- left: MediaQuery.of(context).size.width * 0.4,
- top: _imageCardPosition.dy - 29,
- child: Image.asset(
- 'assets/app_tour/down_right.png',
- width: 40,
- height: 90,
- ),
- ),
- ]),
+ height:MediaQuery.of(context).size.height*0.69 ,
+ child: Stack(
+ children: [
+ Positioned(
+ left: MediaQuery.of(context).size.width*0.4,
+ top: _imageCardPosition.dy-29,
+ child: Image.asset(
+ 'assets/app_tour/down_right.png',
+ width: 40,
+ height: 90,
+ ),
+ ),
+ ]
+ ),
+
),
),
],
@@ -757,52 +751,61 @@ class EconomyStatsState extends ConsumerState {
];
}
- @override
- void initState() {
- super.initState();
- final locale = ref.read(localeProvider);
- fetchData(locale?.languageCode ?? 'en');
- _fetchUserData();
- }
- // @override
- // void didChangeDependencies() {
- // super.didChangeDependencies();
- // // Access the provider here
- // final locale = ref.watch(localeProvider);
- // fetchData(locale); // Pass the locale to the fetchData method
- // }
+@override
+ void initState() {
+super.initState();
+final locale = ref.read(localeProvider);
+fetchData(locale?.languageCode ?? 'en');
+_fetchUserData();
+ }
+
+
+// @override
+// void didChangeDependencies() {
+// super.didChangeDependencies();
+// // Access the provider here
+// final locale = ref.watch(localeProvider);
+// fetchData(locale); // Pass the locale to the fetchData method
+// }
+
+
+Future getUserId() async {
+final prefs = await SharedPreferences.getInstance();
+return prefs.getString('userId'); // Retrieve the userId
+ }
+
+
+Future _fetchUserData() async {
+try {
+final userId = await getUserId();
+print('EDIT PROFILE isPageLoad');
+final adminAuth = await _pb.admins
+ .authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com');
+final adminToken = adminAuth.token;
+print('adminToken- $adminToken');
+final userDetailsResponse = await _pb.collection('users').getOne(
+userId!,
+headers: {
+'Authorization': 'Bearer $adminToken',
+ },
+ );
+final loginCount = userDetailsResponse.data['login_count'];
+print(loginCount);
+if (loginCount == 1) {
+WidgetsBinding.instance.addPostFrameCallback((_) {
+_starTourRender();
+ });
+ }
+ } catch (e) {
+print('Error fetching user details: $e');
+ }
+ }
+
+
+
- Future getUserId() async {
- final prefs = await SharedPreferences.getInstance();
- return prefs.getString('userId'); // Retrieve the userId
- }
- Future _fetchUserData() async {
- try {
- final userId = await getUserId();
- print('EDIT PROFILE isPageLoad');
- final adminAuth = await _pb.admins
- .authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com');
- final adminToken = adminAuth.token;
- print('adminToken- $adminToken');
- final userDetailsResponse = await _pb.collection('users').getOne(
- userId!,
- headers: {
- 'Authorization': 'Bearer $adminToken',
- },
- );
- final loginCount = userDetailsResponse.data['login_count'];
- print(loginCount);
- if (loginCount == 1) {
- WidgetsBinding.instance.addPostFrameCallback((_) {
- _starTourRender();
- });
- }
- } catch (e) {
- print('Error fetching user details: $e');
- }
- }
Future fetchData(locale) async {
const baseUrl = 'https://pb.venbait.in/api/getHomePageData';
@@ -911,7 +914,7 @@ class EconomyStatsState extends ConsumerState {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RoundedCornerContainer(
- key: mainTopic['main_topic'] == 'ECONOMY'
+ key: mainTopic['main_topic'] =='ECONOMY'
? cardTopicKey
: null,
text: mainTopic['main_topic'],
@@ -925,7 +928,7 @@ class EconomyStatsState extends ConsumerState {
SizedBox(
height: myheight / 4.8, // Set dynamic height
child: Container(
- key: mainTopic['main_topic'] == 'ECONOMY'
+ key:mainTopic['main_topic'] == 'ECONOMY'
? cardsKey
: null,
// color: Colors.grey[200], // Set a background color for the scrollable container
@@ -1147,6 +1150,7 @@ class InfoCard extends StatelessWidget {
final encodedTitle = Uri.encodeComponent(title);
final encodedKey = Uri.encodeQueryComponent('home');
+
return GestureDetector(
onTap: () {
context.go(
@@ -1181,6 +1185,7 @@ class InfoCard extends StatelessWidget {
fontSize: 11,
fontWeight: FontWeight.w400,
// color: Colors.black,
+ fontFamily: 'Roboto',
color: Color(0xFF000000),
),
),
@@ -1200,6 +1205,7 @@ class InfoCard extends StatelessWidget {
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 11,
+ fontFamily: 'Roboto',
fontWeight: FontWeight.w400,
color: Color(0xFF8E8E8E),
),
@@ -1218,8 +1224,9 @@ class InfoCard extends StatelessWidget {
Text(
value,
style: TextStyle(
- fontSize: 26,
+ fontSize: 18,
fontWeight: FontWeight.w900,
+ fontFamily: 'Roboto',
color: textcolor ?? Colors.black,
),
),
@@ -1230,4 +1237,4 @@ class InfoCard extends StatelessWidget {
),
);
}
-}
+}
\ No newline at end of file
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart b/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart
new file mode 100644
index 00000000..75e2ccbd
--- /dev/null
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart
@@ -0,0 +1,194 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
+
+
+class BookMark extends ConsumerStatefulWidget {
+ const BookMark({super.key});
+
+ @override
+ ConsumerState createState() => _BookMarkState();
+}
+
+class _BookMarkState extends ConsumerState {
+ // Example dynamic data
+ final List