Merge branch 'dev' of github.com:VinistanSS/FCSC into dev

This commit is contained in:
venbaittech 2025-02-05 10:22:52 +05:30
commit ec156e49dc
14 changed files with 1505 additions and 482 deletions

View File

@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="main.dart" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/frontend/lib/main.dart" />
<option name="filePath" value="$PROJECT_DIR$/lib/main.dart" />
<method v="2" />
</configuration>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -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(),

View File

@ -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."
}

View File

@ -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<ChartScreen1> {
int _activeTabIndex = 0;
dynamic _tabsData = [];
late List<TargetFocus> marriageTargets;
late List<TargetFocus> 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<ChartScreen1> {
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<ChartScreen1> {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Row(
key: bookMarkKey,
children: [
Text(
context.translate(
@ -975,6 +1694,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
Padding(
padding: const EdgeInsets.all(3.34),
child: GridView.builder(
key:cardKey,
itemCount: cardData.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),

View File

@ -207,7 +207,7 @@ class EconomyStatsWidget extends ConsumerStatefulWidget {
class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
List<dynamic> 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<EconomyStatsWidget> {
late TutorialCoachMark tutorialCoachMark;
late List<TargetFocus> homeTargets;
late List<TargetFocus> 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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
},
)..show(context: context);
}
}
void _initTarget() {
homeTargets = [
void _initTarget(){
homeTargets=[
TargetFocus(
identify: 'cardTopicKey',
keyTarget: cardTopicKey,
@ -310,7 +310,7 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
];
}
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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<EconomyStatsWidget> {
];
}
@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<String?> getUserId() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getString('userId'); // Retrieve the userId
}
Future<void> _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<String?> getUserId() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getString('userId'); // Retrieve the userId
}
Future<void> _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<void> fetchData(locale) async {
const baseUrl = 'https://pb.venbait.in/api/getHomePageData';
@ -911,7 +914,7 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
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<EconomyStatsWidget> {
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 {
),
);
}
}
}

View File

@ -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<BookMark> createState() => _BookMarkState();
}
class _BookMarkState extends ConsumerState<BookMark> {
// Example dynamic data
final List<Map<String, dynamic>> dataList = [
{
'title': 'GDP(Constant)',
'subtitle': '(2022)(AED)',
'value': '1.62T',
'valueColor': Color(0xFF80A8CD),
'isBookmark': true
},
{
'title': 'Trade Value',
'subtitle': '(Jan-Jan 2024)-AED',
'value': '215.4B',
'valueColor': Color(0xFF80A8CD),
'isBookmark': true
},
{
'title': 'Electricity Production',
'subtitle': '(2022) (GWh)',
'value': '155,438',
'valueColor': Color(0xFFAA8E83),
'isBookmark': true
},
{
'title': 'Crude Oil Production',
'subtitle': '(2022) (1000 b/d)',
'value': '3,064',
'valueColor': Color(0xFF80A8CD),
'isBookmark': true
},
{
'title': 'Quantitiy of Export Oil',
'subtitle': '(2022) (1000 b/d)',
'value': '2717',
'valueColor': Color(0xFF7DAFBC),
'isBookmark': true
},
{
'title': 'Desalinated Water Production',
'subtitle': '(2022) (MCM)',
'value': '1823.8',
'valueColor': Color(0xFF7DAFBC),
'isBookmark': true
},
];
@override
Widget build(BuildContext context) {
final filteredList = dataList.where((item) => item['isBookmark'] == true)
.toList();
return BaseScaffold(
title: Text('Bookmark'),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, // Two columns
crossAxisSpacing: 10.0,
mainAxisSpacing: 10.0,
mainAxisExtent: 100,
),
itemCount: filteredList.length,
itemBuilder: (context, index) {
return _buildBox(filteredList[index], context);
},
),
),
);
}
// Widget for creating a box
Widget _buildBox(Map<String, dynamic> data, BuildContext context) {
return GestureDetector(
onTap: () {
debugPrint("Box clicked: ${data['title']}");
},
child: Container(
width: MediaQuery
.of(context)
.size
.width * 0.4,
height: 100,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: data['valueColor']),
),
child: Stack(
children: [
Align(
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Align(
alignment: Alignment.center,
child: Text(
data['title'] ?? '',
style: TextStyle(
fontWeight: FontWeight.w500,
),
overflow: TextOverflow.ellipsis,
// Truncate long text
maxLines: 1, // Limit to 1 line
),
),
),
GestureDetector(
onTap: () {
debugPrint("Icon clicked in: ${data['title']}");
setState(() {
// Change isOpen to false when icon is clicked
int index = dataList.indexWhere(
(item) => item['title'] == data['title'],);
if (index != -1) {
dataList[index]['isBookmark'] = false;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Removed From Bookmark',
style: TextStyle(color: Color(0xFF2F692C),
fontWeight: FontWeight.w600),
),
backgroundColor: Color(0xFFD6E9C6),
duration: Duration(seconds: 2),
),
);
} else {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Failed to Remove',
style: TextStyle(color: Color(0xFFEB5F24),
fontWeight: FontWeight.w600),
),
backgroundColor: Color(0xFF544C4C),
duration: Duration(seconds: 2),
),
);
}
});
},
child: Icon(
Icons.bookmarks_rounded,
color: Colors.black,
size: 20,
),
),
],
),
Text(
data['subtitle'] ?? '',
style: TextStyle(
fontWeight: FontWeight.w500, color: Colors.grey),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
Text(
data['value'] ?? '',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: data['valueColor'],
),
),
],
),
),
],
),
),
);
}
}

View File

@ -1,7 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import '../../../../components/indicators/locale_provider.dart';
import '../../../../components/my_toggle.dart';
class FAQPage extends StatefulWidget {
const FAQPage({super.key});
@ -12,63 +17,90 @@ class FAQPage extends StatefulWidget {
class _FAQPageState extends State<FAQPage> {
@override
Widget build(BuildContext context) {
return BaseScaffold(
title: Text('FAQs',
style: TextStyle(
color:Color(0xFF7296BE),
fontWeight: FontWeight.w500,
),),
showBackButton: true,
body: SafeArea(child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Text.rich(
TextSpan(
text: 'Here are some common questions about the ',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.grey,
return Scaffold(
appBar: AppBar(
elevation: 3,
shadowColor: Colors.black,
title: Text('Key Features',),
leading: IconButton(
onPressed: (){
context.go('/user-guide');
},
color: Colors.black,
icon: const Icon(Icons.arrow_back_ios_new),),
actions: [
Consumer(
builder: (context, ref, _) {
final locale = ref.watch(localeProvider); // Current locale
return MyToggle(
isOn: locale?.languageCode == 'en',
knobTextWhenOn: 'ع',
knobTextWhenOff: 'EN',
pathColorWhenOn: Colors.grey.shade300,
pathColorWhenOff: Colors.grey.shade300,
onTap: () {
ref.read(localeProvider.notifier).toggleLocale();
},
);
},
),
],
),
body: SafeArea(
child: Scrollbar(
thumbVisibility: true,
thickness: 6,
radius: Radius.circular(10),
interactive: true,
child:SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container
(
color: Colors.white,
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Text.rich(
TextSpan(
text: 'Here are some common questions about the ',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.grey,
),
children: [
TextSpan(
text:' Federal Competitiveness and Statistics Centre (FCSC),',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
TextSpan(
text: 'mobile application:',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.grey,
),
),
],
),
),
),
children: [
TextSpan(
text:' Federal Competitiveness and Statistics Centre (FCSC),',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
TextSpan(
text: 'mobile application:',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.grey,
),
),
],
),
Container(
padding: const EdgeInsets.all(0.0),
color: Colors.grey[50],
child: QuestionAnswerScrollView(),
),
],
),
),
Expanded(child: Scrollbar(
thumbVisibility: true,
thickness: 8,
radius: Radius.circular(10),
interactive: true,
child:SingleChildScrollView(
child:Container(
padding: const EdgeInsets.all(0.0),
color: Colors.grey[50],
child: QuestionAnswerScrollView(),
),
),
),),
],
),
),
),
);
}

View File

@ -1,8 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/custom_text.dart';
import '../../../../components/indicators/locale_provider.dart';
import '../../../../components/my_toggle.dart';
class UsingFeatures extends StatelessWidget {
@ -517,44 +522,74 @@ class UsingFeatures extends StatelessWidget {
];
return
BaseScaffold( title: Text('Key Features',
style: TextStyle(
color: Color(0xFFAA8E83),
),),
showBackButton: true,
body:SafeArea(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Text(
'FEATURES',
style: TextStyle(
color: Colors.black,// Text color
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
Scaffold(
appBar: AppBar(
elevation: 3,
shadowColor: Colors.black,
title: Text('Key Features',),
leading: IconButton(
onPressed: (){
context.go('/user-guide');
},
color: Colors.black,
icon: const Icon(Icons.arrow_back_ios_new),),
actions: [
Consumer(
builder: (context, ref, _) {
final locale = ref.watch(localeProvider); // Current locale
return MyToggle(
isOn: locale?.languageCode == 'en',
knobTextWhenOn: 'ع',
knobTextWhenOff: 'EN',
pathColorWhenOn: Colors.grey.shade300,
pathColorWhenOff: Colors.grey.shade300,
onTap: () {
ref.read(localeProvider.notifier).toggleLocale();
},
);
},
),
Expanded(child: Scrollbar(
],
),
body:SafeArea(
child: Scrollbar(
thumbVisibility: true,
thickness: 6,
radius: Radius.circular(10),
interactive: true,
child:
Container(
color: Colors.grey[50], // Set the background color here
// child: SingleChildScrollView(
child: CustomTextRich(
textSpans: textSpans,
padding: const EdgeInsets.all(16.0),
textAlign: TextAlign.start,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
color: Colors.white,
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Text(
'FEATURES',
style: TextStyle(
color: Colors.black,// Text color
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
Container(
color: Colors.grey[50], // Set the background color here
// child: SingleChildScrollView(
child: CustomTextRich(
textSpans: textSpans,
padding: const EdgeInsets.all(16.0),
textAlign: TextAlign.start,
),
),
],
),
),
),),
],
), ),
)
),
),
);
}
}

View File

@ -1,5 +1,7 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/custom_text.dart';
@ -7,6 +9,9 @@ import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.
import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../../components/indicators/locale_provider.dart';
import '../../../../components/my_toggle.dart';
class GettingStarted extends StatelessWidget {
GettingStarted({super.key});
@ -66,55 +71,90 @@ class GettingStarted extends StatelessWidget {
];
return BaseScaffold( title: Text('About the App',
style: TextStyle(
color:Color(0xFF265E84),
fontWeight: FontWeight.w500,
return Scaffold(
appBar: AppBar(
elevation: 3,
shadowColor: Colors.black,
title: Text('About the App',),
leading: IconButton(
onPressed: (){
context.go('/user-guide');
},
color: Colors.black,
icon: const Icon(Icons.arrow_back_ios_new),),
actions: [
Consumer(
builder: (context, ref, _) {
final locale = ref.watch(localeProvider); // Current locale
return MyToggle(
isOn: locale?.languageCode == 'en',
knobTextWhenOn: 'ع',
knobTextWhenOff: 'EN',
pathColorWhenOn: Colors.grey.shade300,
pathColorWhenOff: Colors.grey.shade300,
onTap: () {
ref.read(localeProvider.notifier).toggleLocale();
},
);
// IconButton(
// icon: Icon(locale?.languageCode == 'en'
// ? Icons.toggle_off_outlined
// : Icons.toggle_on_outlined,),
// onPressed: () {
// ref.read(localeProvider.notifier).toggleLocale();
// },
// );
},
),
],
),
),
showBackButton: true,
body:SafeArea(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Text.rich(
TextSpan(
text: 'The',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.grey,
),
children: [
TextSpan(
text:' Federal Competitiveness and Statistics Centre (FCSC),',
// title: Text('About the App',),
// showBackButton: true,
body:SafeArea(
child: Scrollbar(
thumbVisibility: true,
thickness: 6,
radius: Radius.circular(10),
interactive: true,
child:SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
color: Colors.white,
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Text.rich(
TextSpan(
text: 'The',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.black87,
color: Colors.grey,
),
),
TextSpan(
text:' in your App is designed to provide registered and approved users with access to accurate and comprehensive statistics about the UAE. The app serves as a centralized platform for exploring key datasets, trends, and insights across various sectors.',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.grey,
children: [
TextSpan(
text:' Federal Competitiveness and Statistics Centre (FCSC),',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
TextSpan(
text:' in your App is designed to provide registered and approved users with access to accurate and comprehensive statistics about the UAE. The app serves as a centralized platform for exploring key datasets, trends, and insights across various sectors.',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.grey,
),
),
],
),
),
],
),
),
),
Expanded(child: Scrollbar(
thumbVisibility: true,
thickness: 6,
radius: Radius.circular(10),
interactive: true,
child: SingleChildScrollView(
child: Column(
),
Column(
children: [
Container(
color: Colors.grey[50], // Set the background color here
@ -169,11 +209,11 @@ class GettingStarted extends StatelessWidget {
),
],
),
),
),),
],
), ),
],
),
),
),
),
);
}
}

View File

@ -15,15 +15,16 @@ class _UserGuideState extends State<UserGuide> {
List<Widget> createRows(List<List<Map<String, dynamic>>> items) {
return items.map((pair) {
return Padding(
padding: const EdgeInsets.only(bottom: 20), // Add space between rows
padding: const EdgeInsets.only(bottom: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment: pair.length == 1
? MainAxisAlignment.center
: MainAxisAlignment.spaceEvenly,
children: pair.map((item) {
return userGuides(
color: item['color'] as Color,
text: item['text'] as String,
dynamicIcon: item['icon'],
no: item['index'] as String,
routePath:item['routePath']as String,
);
}).toList(),
@ -36,17 +37,16 @@ class _UserGuideState extends State<UserGuide> {
title: Text('User Guide'),
body: SingleChildScrollView(
child: Container(
color: Colors.grey[300], // Grey background for content
padding: const EdgeInsets.all(16.0), // Padding around content
child: Column(
children: createRows([
// Each pair defines a row of (Color, Text) pairs
[
{'routePath':'gettingStarted','color': Color(0xFF90B0D5), 'text': 'Getting Started', 'icon': 'START', 'index': '1'},
{'routePath':'features','color': Color(0xFFAA8E83), 'text': 'Using Features', 'icon': Icons.stars_outlined, 'index': '2'},
{'routePath':'gettingStarted','color': Color(0xFF90B0D5), 'text': 'Getting Started', 'icon': 'START',},
{'routePath':'features','color': Color(0xFFAA8E83), 'text': 'Using Features', 'icon': Icons.stars_outlined,},
],
[
{'routePath':'faq','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': Icons.question_answer_sharp, 'index': '3'},
{'routePath':'faq','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': Icons.question_answer_sharp,},
// {'routePath':'features','color': Color(0xFF7DAFBC), 'text': 'Advanced Settings', 'icon': Icons.settings_outlined, 'index': '6'},
],
]),
@ -58,21 +58,20 @@ class _UserGuideState extends State<UserGuide> {
class userGuides extends StatelessWidget {
const userGuides({super.key, required this.routePath ,required this.color, required this.text,required this.dynamicIcon,required this.no});
const userGuides({super.key, required this.routePath ,required this.color, required this.text,required this.dynamicIcon});
final Color color;
final String text;
final dynamic dynamicIcon;
final String no;
final String routePath;
Widget buildDynamicWidget(dynamic icons) {
Widget buildDynamicWidget(dynamic icons, Color iconColor) {
if (dynamicIcon is IconData) {
return Icon(
icons,
size: 38,
color: Colors.white,
color: iconColor,
);
} else if (dynamicIcon is String) {
// Create a Text widget if variable is a String
@ -81,7 +80,7 @@ class userGuides extends StatelessWidget {
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 20,
color: Colors.white,
color: iconColor,
),
);
} else {
@ -96,67 +95,52 @@ class userGuides extends StatelessWidget {
@override
Widget build(BuildContext context) {
final double screenWidth= MediaQuery.of(context).size.width;
final double screenHeight= MediaQuery.of(context).size.height;
return InkWell(
onTap: (){
context.push('/user-guide/$routePath');
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 4),
height: 115,
width: 148,
margin: EdgeInsets.all(1),
decoration: BoxDecoration(
color: color,
padding: EdgeInsets.symmetric(horizontal: 4),
height: 110,
width: screenWidth * 0.40,
margin: EdgeInsets.all(1),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
alignment: Alignment.center,
child: Stack(
children: [Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Icon(
// size:38,
// icons, // Home icon
// color: Colors.white,
// ),
buildDynamicWidget(dynamicIcon),
border: Border.all(color: color,
width: 2.0)
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Icon(
// size:38,
// icons, // Home icon
// color: Colors.white,
// ),
buildDynamicWidget(dynamicIcon, color),
SizedBox(width: 10,height: 15,), // Space between icon and text
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 4), // Padding inside the text background
decoration: BoxDecoration(
color: Colors.white, // Background color for text
borderRadius: BorderRadius.circular(5), // Rounded corners for text background
),
child: Text(
text,
style: TextStyle(
color: color, // Text color
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
SizedBox(width: 10,height: 10,), // Space between icon and text
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 5), // Padding inside the text background
decoration: BoxDecoration(
color: color, // Background color for text
borderRadius: BorderRadius.circular(5),
),
child: Text(
text,
style: TextStyle(
color: Colors.white, // Text color
fontWeight: FontWeight.bold,
),
],
textAlign: TextAlign.center,
),
),
Positioned(
top: 6, // Distance from the top of the container
left: 6, // Distance from the left of the container
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
color: Colors.transparent, // Background color for the number
child: Text(
no,
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
),],
)
],
),
),
);
}

View File

@ -124,7 +124,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
text: AppLocalizations.of(context)!.tour_navBar,
alignment: ContentAlign.top,
space: 0,
gap: 100,
gap: 105,
),
TargetContent(
align: ContentAlign.top,
@ -138,37 +138,43 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
bottom: 25,
left: 16,
right: 16,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Column(
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(
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.only(right:10.0),
child: Text(
'5/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
const SizedBox(height: 3),
),
),
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(
@ -187,9 +193,9 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
.state = true;
ref
.read(previousChartsTourProvider
.notifier)
.notifier)
.state = false;
context.push('/marriages');
context.go('/chartScreen/hotels?bgColor=0xFF90B0D5&mainTopic=ECONOMY&title=Hotel+Establishments');
},
),
),
@ -220,22 +226,6 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
),
),
),
TargetContent(
padding: EdgeInsets.only(left: screenWidth * 0.4, bottom: 0),
align: ContentAlign.top,
child: Container(
width: 200,
height: 100,
child: Stack(
children: [
Image.asset(
'assets/app_tour/leftUp.png',
fit: BoxFit.contain,
),
],
),
),
),
],
),
TargetFocus(
@ -255,45 +245,50 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
align: ContentAlign.bottom,
child: SizedBox(
width: double.infinity,
height: MediaQuery.of(context).size.height *
0.80, // Set an appropriate height for the Stack
height: MediaQuery.of(context).size.height * 0.80,
child: Stack(
children: [
Positioned(
bottom: 25,
left: 16,
right: 16,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Column(
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(
Align(
alignment: Alignment.bottomRight,
child:Padding(
padding: const EdgeInsets.only(right:10.0),
child: Text(
'6/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
const SizedBox(height: 3),
),
),
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(
@ -339,7 +334,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
),
TargetContent(
padding: EdgeInsets.only(
right: screenWidth * 0.7, top: toggleHeight - 5),
right: screenWidth * 0.7, top: 30),
align: ContentAlign.right,
child: Container(
width: 200,
@ -392,37 +387,43 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
bottom: 25,
left: 16,
right: 16,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Column(
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(
Align(
alignment: Alignment.bottomRight,
child:Padding(
padding: const EdgeInsets.only(right:10.0),
child: Text(
'7/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
const SizedBox(height: 3),
),
),
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(
@ -448,10 +449,10 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
.state = true;
ref
.read(
previousChartsTourProvider.notifier)
previousChartsTourProvider.notifier)
.state = true;
ref.read(homeTourProvider.notifier).state =
true;
true;
ref
.read(previousHomeTourProvider.notifier)
.state = true;
@ -460,7 +461,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
.state = true;
ref
.read(previousScaffoldTourProvider
.notifier)
.notifier)
.state = true;
tutorialCoachMark.finish();
},
@ -493,7 +494,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
),
TargetContent(
padding:
EdgeInsets.only(left: screenWidth * 0.7, top: toggleHeight),
EdgeInsets.only(left: screenWidth * 0.7, top: toggleHeight),
align: ContentAlign.left,
child: Container(
width: 200,
@ -746,6 +747,11 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
),
onTap: () => context.go('/manageuser'),
),
ListTile(
leading: Icon(Icons.collections_bookmark_rounded),
title: const Text('Bookmark'),
onTap: () => context.go('/bookmark'),
),
ListTile(
leading: Icon(Icons.book),
// title: const Text('User Guide'),

View File

@ -5,23 +5,23 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
url: "https://pub.dev"
source: hosted
version: "76.0.0"
version: "72.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.3"
version: "0.3.2"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
url: "https://pub.dev"
source: hosted
version: "6.11.0"
version: "6.7.0"
analyzer_plugin:
dependency: transitive
description:
@ -210,10 +210,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.19.0"
version: "1.18.0"
connectivity_plus:
dependency: "direct main"
description:
@ -306,10 +306,10 @@ packages:
dependency: transitive
description:
name: custom_lint_visitor
sha256: bfe9b7a09c4775a587b58d10ebb871d4fe618237639b1e84d5ec62d7dfef25f9
sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d"
url: "https://pub.dev"
source: hosted
version: "1.0.0+6.11.0"
version: "1.0.0+6.7.0"
dart_style:
dependency: transitive
description:
@ -433,10 +433,10 @@ packages:
dependency: "direct main"
description:
name: fl_chart
sha256: "5276944c6ffc975ae796569a826c38a62d2abcf264e26b88fa6f482e107f4237"
sha256: "74959b99b92b9eebeed1a4049426fd67c4abc3c5a0f4d12e2877097d6a11ae08"
url: "https://pub.dev"
source: hosted
version: "0.70.2"
version: "0.69.2"
flutter:
dependency: "direct main"
description: flutter
@ -837,18 +837,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.7"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.8"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
@ -877,10 +877,10 @@ packages:
dependency: transitive
description:
name: macros
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
url: "https://pub.dev"
source: hosted
version: "0.1.3-main.0"
version: "0.1.2-main.4"
mailer:
dependency: "direct main"
description:
@ -1268,7 +1268,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
version: "0.0.99"
smart_api_client:
dependency: "direct main"
description:
@ -1352,10 +1352,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.11.1"
state_notifier:
dependency: transitive
description:
@ -1384,10 +1384,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.2.0"
syncfusion_flutter_charts:
dependency: "direct main"
description:
@ -1424,10 +1424,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.3"
version: "0.7.2"
the_validator:
dependency: "direct main"
description:
@ -1592,10 +1592,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.3.0"
version: "14.2.5"
watcher:
dependency: transitive
description:

View File

@ -22,7 +22,7 @@ dependencies:
riverpod_annotation: ^2.3.3
cupertino_icons: ^1.0.6
fl_chart: ^0.70.2
fl_chart: ^0.69.2
tutorial_coach_mark: ^1.2.12
marquee: ^2.2.3
url_launcher: ^6.3.1