code merged

This commit is contained in:
venbaittech 2025-01-07 09:48:01 +05:30
commit 65cf46226c
18 changed files with 1684 additions and 243 deletions

View File

@ -29,8 +29,8 @@ android {
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
defaultConfig {

View File

@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
org.gradle.java.home=C:/Program Files/Eclipse Adoptium/jdk-21.0.5.11-hotspot

View File

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip

View File

@ -18,8 +18,9 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
id "com.android.application" version "8.2.1" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}
include ":app"

View File

@ -294,8 +294,12 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/competitiveness.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/country_profile.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/uae_numbers.dart';
import 'package:uae_stat/presentation/Screens/auth_verification/registration.dart';
import 'package:uae_stat/presentation/Screens/demo_home2.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/getting_started.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import '../domain/use_cases/preferences_use_case.dart';
@ -308,7 +312,11 @@ 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 '../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';
import '../presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart';
import '../presentation/routes/drawer_routes/Drawer Items/user_guide/user_guide.dart';
import '../presentation/routes/drawer_routes/Drawer Items/manage_users.dart';
final GoRouter router = GoRouter(
@ -321,6 +329,7 @@ final GoRouter router = GoRouter(
GoRoute(
path: '/login',
builder: (context, state) => LoginRoute(),
//builder: (context, state) => LoginRoute(),
),
GoRoute(
path: '/myhomepage',
@ -357,10 +366,11 @@ final GoRouter router = GoRouter(
),
),
GoRoute(
path: '/changepassword',
builder: (context, state) => Changepassword(
userId: '',
),
path: '/changepassword/:userId',
builder: (context, state) {
final userId = state.pathParameters['userId']!;
return Changepassword(userId: userId);
},
),
GoRoute(
path: '/createNewPw/:userId/:email',
@ -383,23 +393,59 @@ final GoRouter router = GoRouter(
path: '/feedback',
builder: (context, state) => FeedbackForm(),
),
//Sub route
GoRoute(
path: '/profile',
builder: (context, state) => ProfileScreen(
userId: '',
),
path: '/profile/:userId',
builder: (context, state) {
final userId = state.pathParameters['userId']!;
return ProfileScreen(userId: userId);
},
),
GoRoute(
path: '/user-guide',
builder: (context, state) => UserGuide(),
routes: <RouteBase>[
GoRoute(
path: '/features',
name: 'features',
builder: (context, state) => UsingFeatures(),
),
GoRoute(
path: '/faq',
name: 'faq',
builder: (context, state) => FAQPage(),
),
GoRoute(
path: '/gettingStarted',
name: 'gettingStarted',
builder: (context, state) => GettingStarted(),
),
],
),
GoRoute(
path: '/editProfile',
builder: (context, state) => EditProfile(),
),
// GoRoute(
// path: '/manageuser',
// builder: (context, state) {
// // Retrieve the title from extra or query params
// final title = state.extra as String? ?? 'Manage users';
// return ManageUserRouter(title: title);
// },
// ),
GoRoute(
path: '/manageuser',
builder: (context, state) => ManageUserRouter(),
),
// Bottom Navigation Routes
GoRoute(
path: '/uaenumbers',
builder: (context, state) => UaeNumbers(),
),
GoRoute(
path: '/competitiveness',
builder: (context, state) => Competitiveness(),
),
GoRoute(
path: '/countryprofile',
builder: (context, state) => CountryProfile(),
),
],
);

View File

@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class Competitiveness extends StatelessWidget {
const Competitiveness({super.key});
@override
Widget build(BuildContext context) {
double myheight = MediaQuery.of(context).size.height;
double mywidth = MediaQuery.of(context).size.width;
return BaseScaffold(
title: Center(
child: SizedBox(
height: myheight / 5,
width: mywidth / 3,
child: Image(image: AssetImage('assets/logos/uae_stat.png')))),
body: CompetitivenessState(context),
);
}
Widget CompetitivenessState(BuildContext context) {return Center(child: Text("Competitiveness"));}
}

View File

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class CountryProfile extends StatelessWidget {
const CountryProfile({super.key});
@override
Widget build(BuildContext context) {
double myheight = MediaQuery.of(context).size.height;
double mywidth = MediaQuery.of(context).size.width;
return BaseScaffold(
title: Center(
child: SizedBox(
height: myheight / 5,
width: mywidth / 3,
child: Image(image: AssetImage('assets/logos/uae_stat.png')))),
body: CountryProfileWidget()
);
}
}
class CountryProfileWidget extends StatelessWidget {
const CountryProfileWidget({super.key});
@override
Widget build(BuildContext context) {
return Center(child: Text("COuntry Profile"),);
}
}

View File

@ -0,0 +1,292 @@
import 'package:flutter/material.dart';
import 'package:uae_stat/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import 'package:uae_stat/presentation/components/constant/constant.dart';
class UaeNumbers extends StatelessWidget {
const UaeNumbers({super.key});
@override
Widget build(BuildContext context) {
double myheight = MediaQuery.of(context).size.height;
double mywidth = MediaQuery.of(context).size.width;
return BaseScaffold(
title: Text("UAE Numbers"),
body:
//EconomicDashboard(),
//EconomyExpandTile()
uaenumberWidget());
}
}
class uaenumberWidget extends StatelessWidget {
const uaenumberWidget({super.key});
@override
Widget build(BuildContext context) {
double myheight = MediaQuery.of(context).size.height;
double mywidth = MediaQuery.of(context).size.width;
return Padding(
padding: const EdgeInsets.all(16.0),
child: ListView(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(30.0),
border: Border.all(width: 1)
),
child: TextField(
decoration: InputDecoration(
hintText: "Search",
prefixIcon: Icon(Icons.search),
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0),
),
),
),
SizedBox(height: myheight/35,),
CustomExpandableTile(
title: 'ECONOMY',
titleBackgroundColor: economyColor,
children: [
buildCategoryTitle('National Accounts',economyColor),
buildCardRow([
buildCard(context,'GDP (Constant)', '1.62T', '2022 (AED)',economyColor,economyColor,mywidth/2.5),
buildCard(context,'FDI', '1.45T', '2021 (AED)',economyColor,economyColor,mywidth/2.5),
]),
buildCategoryTitle('International Trade',economyColor),
buildCardRow([
buildCard(context,'Total Trade', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5),
buildCard(context,'Total Import', '686B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5),
]),
buildCardRow([
buildCard(context,'Total Export', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5),
buildCard(context,'Total ReExport', '686B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5),
]),
buildCategoryTitle('Prices',economyColor),
buildCardRow([
buildCard(context,'Total Export', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/1.2),
]),
],
),
CustomExpandableTile(
title: 'SOCIAL',
titleBackgroundColor: socialColor,
children: [
buildCategoryTitle('Population',socialColor),
buildCardRow([
InkWell(onTap: (){},child: buildCard(context,'Population', '9.89M', '2024',socialColor,socialColor,mywidth/2.5)),
buildCard(context,'Population Growth', '2.1%', '2023',socialColor,socialColor,mywidth/2.5),
]),
buildCategoryTitle('Vital Statistics',socialColor),
buildCardRow([
buildCard(context,'Marriages', '96%', '2023',socialColor,socialColor,mywidth/2.5),
buildCard(context,'Divorces', '1.2K', '2024',socialColor,socialColor,mywidth/2.5),
]),
buildCategoryTitle('Education',socialColor),
buildCardRow([
buildCard(context,'General Education', '96%', '2023',socialColor,socialColor,mywidth/2.5),
buildCard(context,'Higher Education', '1.2K', '2024',socialColor,socialColor,mywidth/2.5),
]),
buildCategoryTitle('Health',socialColor),
buildCardRow([
buildCard(context,'Hospital', '96%', '2023',socialColor,socialColor,mywidth/2.5),
buildCard(context,'Clinic and Centres', '1.2K', '2024',socialColor,socialColor,mywidth/2.5),
]),
],
),
CustomExpandableTile(
title: 'ENVIRONMENT',
titleBackgroundColor: environmentColor,
children: [
buildCategoryTitle('Agriculture',environmentColor),
buildCardRow([
buildCard(context,'Crops - Total Area', '27°C', 'Average 2024',environmentColor,environmentColor,mywidth/2.5),
buildCard(context,'Livestock', '120mm', '2024',environmentColor,environmentColor,mywidth/2.5),
]),
buildCategoryTitle('Environment',environmentColor),
buildCardRow([
buildCard(context,'Climate - Max Temp', '15%', '2024',environmentColor,environmentColor,mywidth/2.5),
buildCard(context,'Climate - Min Temp', '30%', '2023',environmentColor,environmentColor,mywidth/2.5),
]),
buildCardRow([
buildCard(context,'Desalinated Produced Water', '15%', '2024',environmentColor,environmentColor,mywidth/2.5),
buildCard(context,'Area of Natural Reserves', '30%', '2023',environmentColor,environmentColor,mywidth/2.5),
]),
buildCategoryTitle('Energy',environmentColor),
buildCardRow([
buildCard(context,'Electricity Production', '15%', '2024',environmentColor,environmentColor,mywidth/2.5),
buildCard(context,'Renewable Energy Production', '30%', '2023',environmentColor,environmentColor,mywidth/2.5),
]),
],
),
],
),
);
}
Widget buildCategoryTitle(String title,Color color) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Text(
title,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: color,
),
),
);
}
Widget buildCardRow(List<Widget> cards) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: cards.map((card) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.0),
child: card,
);
}).toList(),
),
);
}
Widget buildCard(BuildContext context,String title, String value, String subtitle,Color bordercolor,boldColor,double mywidth) {
// double myheight = MediaQuery.of(context).size.height;
// double mywidth = MediaQuery.of(context).size.width;
return Card(
elevation: 2,
child: Container(
width: mywidth,
decoration: BoxDecoration(
color: Colors.white, // Background color
border: Border.all(
color: bordercolor, // Border color
width: 2, // Border width
),
borderRadius: BorderRadius.circular(12), // Optional: Rounded corners
),
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
title,
textAlign: TextAlign.center,
style: robotoRegular11,
),
SizedBox(height: 8),
Text(
subtitle,
textAlign: TextAlign.center,
style: subtitleStyle
),
SizedBox(height: 8),
Text(
value,
style: TextStyle(
fontSize: 26,
color: boldColor,
fontWeight: FontWeight.bold,
),
),
],
),
),
);
}
}
class CustomExpandableTile extends StatefulWidget {
final String title;
final Color titleBackgroundColor;
final List<Widget> children;
const CustomExpandableTile({
required this.title,
required this.titleBackgroundColor,
required this.children,
});
@override
_CustomExpandableTileState createState() => _CustomExpandableTileState();
}
class _CustomExpandableTileState extends State<CustomExpandableTile> {
bool isExpanded = false;
@override
Widget build(BuildContext context) {
double myheight = MediaQuery.of(context).size.height;
return Card(
elevation: 4,
child: Column(
children: [
GestureDetector(
onTap: () {
setState(() {
isExpanded = !isExpanded;
});
},
child: Container(
decoration: BoxDecoration(
color: widget.titleBackgroundColor,
borderRadius: BorderRadius.all(Radius.circular(12))
),
padding: const EdgeInsets.all(12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
widget.title,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
Icon(
isExpanded
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.white,
),
],
),
),
),
ClipRRect(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
width: double.infinity,
height: isExpanded ? myheight : 0,
child: isExpanded
? SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20))
),
padding: const EdgeInsets.all(10),
child: Column(
children: widget.children,
),
),
)
: null,
),
),
],
),
);
}
}

View File

@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
const Color economyColor = Color(0xFF90B0D5);
const Color socialColor = Color(0xFFAA8E83);
const Color environmentColor = Color(0xFF7DAFBC);
const Color environmentboldColor = Color(0xFF90B0D5);
const TextStyle subtitleStyle = TextStyle(
fontFamily: 'Roboto', // Font family set to Roboto
fontWeight: FontWeight.w400, // Regular weight (w400)
fontSize: 11,
color: Color(0xFF8E8E8E) // Font size 11
);
const TextStyle robotoRegular11 = TextStyle(
fontFamily: 'Roboto', // Font family set to Roboto
fontWeight: FontWeight.w400, // Regular weight (w400)
fontSize: 11,
color: Color(0xFF000000) // Font size 11
);

View File

@ -457,8 +457,9 @@ class LoginRoute extends HookConsumerWidget {
final continueAsGuestBtn = SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () => context
.go('/${context.language}/${BottomNavBarItem.home.routePath}'),
onPressed: () =>
context.go('/myhomepage'),
//context.go('/${context.language}/${BottomNavBarItem.home.routePath}'),
style: ButtonStyle(
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(

View File

@ -0,0 +1,65 @@
import 'package:flutter/material.dart';
class CustomContainer extends StatelessWidget {
final String text;
final EdgeInsetsGeometry padding;
final bool isBulletPoint;
final TextStyle? textStyle;
final double? fontSize;
final double? height;
final double defaultFontSize ;
final TextDecoration textDecoration ;
final Color? decorationColor;
final FontWeight fontWeight;
final Color color;
const CustomContainer({
super.key,
required this.text,
this.padding = const EdgeInsets.all(8.0),
this.isBulletPoint = false,
this.textStyle,
this.fontSize,
this.defaultFontSize=14,
this.height,
this.textDecoration = TextDecoration.none,
this.fontWeight =FontWeight.w500,
this.decorationColor,
this.color=const Color(0xFF898C81),
});
@override
Widget build(BuildContext context) {
return Padding(
padding: padding,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (isBulletPoint)
Text(
"",
style: TextStyle(fontSize: fontSize ?? defaultFontSize,
color: color,
fontWeight: fontWeight,
height: height,),
),
Expanded(
child: Text(
text,
style: TextStyle(
fontSize: fontSize ?? defaultFontSize,
color: color,
fontWeight: fontWeight,
height: height,
decoration: textDecoration,
decorationColor: decorationColor ?? color,
),
),
),
],
),
);
}
}

View File

@ -0,0 +1,130 @@
import 'package:flutter/material.dart';
import '../../custom_drawer_routes.dart';
class FAQPage extends StatefulWidget {
const FAQPage({super.key});
@override
State<FAQPage> createState() => _FAQPageState();
}
class _FAQPageState extends State<FAQPage> {
@override
Widget build(BuildContext context) {
return BaseScaffold(
title: Text('FAQs'),
body: Scrollbar(
thumbVisibility: true,
thickness: 6,
radius: Radius.circular(10),
interactive: true,
child:SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Text(
'HERE ARE SOME COMMON QUESTIONS ABOUT THE FEDERAL COMPETITIVENESS AND STATISTICS CENTRE (FCSC) MOBILE APPLICATION:',
style: TextStyle(
color: Color(0xFF265E84), // Text color
fontSize: 18,
fontWeight: FontWeight.w600
),
),
),
Container(
padding: const EdgeInsets.all(0.0),
color: Colors.grey,
child: QuestionAnswerScrollView()
)
],
),
),
),
);
}
}
class QuestionAnswerScrollView extends StatelessWidget {
final List<Map<String, String>> questionsAndAnswers = [
{'question': '1. What is the purpose of this app?', 'answer': 'The app provides official UAE statistics across categories like Economy, Environment, and Social. It allows users to explore datasets, view trends, and access detailed metrics to make informed decisions.'},
{'question': '2. How do I bookmark a metric?',
'answer': 'When viewing a metric, tap on the Bookmark icon. Your bookmarks are accessible from the My Bookmarks section in the navigation bar.'},
{'question': '3.Can I view the app in another language?', 'answer': 'Yes, the app supports both English and Arabic. You can toggle the language using the switch in the top-right corner of the app.'},
{'question': '4.What happens if I forget my password?','answer':'Tap on the Forgot Password? link on the login page. Follow the steps to reset your password via your registered email address.'},
{'question':'5. Can I edit my profile details?','answer': 'Yes, you can edit specific fields such as Date of Birth and User Image. However, certain fields like Username and Email are non-editable for security reasons.'},
{'question':'6.How often is the data updated?','answer':'The app updates its datasets regularly to ensure users have access to the latest statistics. Notifications are sent whenever significant updates are made.'},
{'question':'7.Do I need to create an account to use the app?',
'answer':"Yes, the app is strictly for registered and approved users. To access the data:You need to sign up using the Register Now option on the login screen .Your registration must be approved by the admin.Once approved, you can log in to access the app's features and datasets.Guest access is not available for this application."},
{'question':'8.How can I navigate through the app?','answer':'Use the main categories on the homepage (e.g., Economy, Environment) to access subcategories and detailed KPIs.Drill down into specific metrics or graphical views by tapping on a KPI.Access additional features like Bookmarks or Profile through the navigation bar.'},
{'question':'9.What types of data are available?','answer':'The app offers data on:Economy: GDP, growth rates, and economic trends.Environment: Electricity production, water consumption, and more.Social: Labor force distribution, participation rates, and demographic data.'},
{'question':'10.What types of graphs and charts are available?','answer':'The app provides a variety of visualizations, including:Line charts for trends.Bar and column charts for comparisons.Stacked charts for multi-layered data views.'},
];
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: questionsAndAnswers.map((qa) => QuestionAnswerCard(qa: qa)).toList(),
),
);
}
}
class QuestionAnswerCard extends StatefulWidget {
final Map<String, String> qa;
QuestionAnswerCard({required this.qa});
@override
_QuestionAnswerCardState createState() => _QuestionAnswerCardState();
}
class _QuestionAnswerCardState extends State<QuestionAnswerCard> {
bool isExpanded = false;
@override
Widget build(BuildContext context) {
return Card(
color: Colors.white,
elevation: 1,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.zero, // No rounding, it's a rectangle
),
margin: EdgeInsets.symmetric(vertical: 0,),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
dense: true,
textColor:Color(0xFF414042),
title: Text(
widget.qa['question']!,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15),
),
trailing: Icon(isExpanded ? Icons.remove : Icons.add),
onTap: () {
setState(() {
isExpanded = !isExpanded;
});
},
),
if (isExpanded)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
widget.qa["answer"]!,
style: TextStyle(color: Colors.grey),
),
),
],
),
);
}
}

View File

@ -0,0 +1,621 @@
import 'package:flutter/material.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import 'custom_text.dart';
class UsingFeatures extends StatelessWidget {
final List<Map<String, dynamic>> contentList = [
{
"text": "1.Data-Driven Insights:",
"fontSize": 16.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.bold,
"isBulletPoint": false,
},
{
"text": "1.Access detailed datasets across categories such as Economy, Environment, Social, and more.Explore statistics presented as smart metrics, graphs, and charts for better understanding.",
"fontSize": 13.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "2.Drilldown Navigation:",
"fontSize": 16.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.bold,
"isBulletPoint": false,
},
{
"text": "Start from high-level categories such as “Economy” and drill down into detailed KPIs, sub-sections, and graphical views for a better understanding of each topic.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "3.Interactive Visualizations:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.bold,
"isBulletPoint": false,
},
{
"text": "View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "Secure User Access:",
"fontSize": 14.0,
"height":1.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.bold,
"isBulletPoint": true,
},
{
"text": "4.Available only to registered users whose accounts have been approved by an admin.Login ensures secure access to sensitive statistical information.",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "5.Profile Customization:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.bold,
"isBulletPoint": false,
},
{
"text": "Update your profile details, such as name, password, and region, to personalize your experience.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "6.Bookmark:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.bold,
"isBulletPoint": false,
},
{
"text": "Save frequently accessed metrics and datasets for quick reference via the Bookmarks section.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "7.Bilingual Support:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.bold,
"isBulletPoint": false,
},
{
"text": "Toggle between English and Arabic for ease of use.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "Who Can Use the App?",
"fontSize": 18.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "This app is intended for:",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "Government officials requiring UAE statistics for decision-making.",
"fontSize": 14.0,
"height":0.9,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "Business professionals and researchers analyzing market trends.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"height":0.9,
"isBulletPoint": true,
},
{
"text": "Students and educators needing reliable data for study and teaching.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"height":0.9,
"isBulletPoint": true,
},
{
"text": "Purpose of the App",
"fontSize": 16.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Provide official statistics on the UAE in an accessible format.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"height":0.9,
"isBulletPoint": true,
},
{
"text": "Support decision-making and research with reliable, up-to-date data.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"height":0.9,
"isBulletPoint": true,
},
{
"text": "Enable users to interact with data visually through graphs and metrics.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"height":0.9,
"isBulletPoint": true,
},
{
"text": "How to Use the App",
"fontSize": 16.0,
"color":Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "1.Registration and Approval:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Sign up for the app and wait for admin approval.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "2.Login and Navigation:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Once approved, log in to access the app. Navigate through the categories on the home screen.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "3.Access Data:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": 'Drill down into specific categories like "Economy" or "Environment" to view detailed KPIs and visual insights.',
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "4.Bookmark Metrics:",
"fontSize": 14.0,
"color":Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": 'Save important statistics for easy reference.',
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "Stay Updated",
"fontSize": 16.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": 'The app is regularly updated with the latest datasets and features to ensure users have access to the most current information.',
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "How to Change My Password",
"fontSize": 14.0,
"color":Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Changing your password helps keep your account secure. Follow these steps to update your password:",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "Steps to Change Password",
"fontSize": 16.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "1. Access the Change Password Page:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": 'From the Profile page, tap on the "Change Password" link at the bottom.',
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "2. Enter Old Password:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Enter your current password in the first field.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "3. Set a New Password:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Enter your new password in the second field.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "Re-enter the new password in the third field for confirmation.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "4. Password Requirements:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Your new password must be different from the previously used password.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "5.Save Your Password",
"fontSize": 14.0,
"color":Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Tap the Save button.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "A confirmation message will appear: “Password has been successfully updated.”",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "6.Re-Login:",
"fontSize": 14.0,
"color":Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Log in again using your new password to continue using the app",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "How to Edit My Profile",
"fontSize": 16.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Editing your profile allows you to update specific information while ensuring that critical details remain secure. Follow the steps below to update your profile:",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "Steps to Edit Profile",
"fontSize": 16.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "1.Access the Profile Page:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": 'Tap on the "Profile" option from the navigation bar at the top left corner of the screen.',
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "2.Editable Fields:",
"fontSize": 14.0,
"color":Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Full Name: Tap the text box to enter your name (up to 40 alphanumeric characters).",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "Date of Birth: Use the calendar dropdown to select your date of birth.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "Country/Region: Choose your current location from the dropdown menu.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "User Image: Tap on the avatar icon to upload or change your profile picture.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "3.Non-Editable Fields:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Username and Email ID: These fields cannot be edited to ensure the integrity of your account.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "Agree to Terms and Conditions:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": 'Ensure that the checkbox for "I agree to Terms & Conditions and Privacy Policy" is selected before saving changes.',
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": false,
},
{
"text": "Save Your Changes:",
"fontSize": 14.0,
"color": Color(0xFF414042),
"fontWeight": FontWeight.w600,
"isBulletPoint": false,
},
{
"text": "Tap the Save button at the bottom of the screen.",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "A confirmation dialog will appear with the message:",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
{
"text": "“Are you sure you want to save this page? Once saved, you will not be able to change your name or date of birth.”",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint":false ,
},
{
"text": "Select Confirm to save the changes or Cancel to go back",
"fontSize": 14.0,
"color": Color(0xFF898C81),
"fontWeight": FontWeight.normal,
"isBulletPoint": true,
},
// Add more items here as needed
];
@override
Widget build(BuildContext context) {
return BaseScaffold( title: Text('Key Features'),
body: Scrollbar(
thumbVisibility: true,
thickness: 6,
radius: Radius.circular(10),
interactive: true,
child:SingleChildScrollView(
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: Color(0xFF265E84), // Text color
fontSize: 18,
fontWeight: FontWeight.w600
),
),
),
Container(
padding: const EdgeInsets.all(13.0),
color: Color(0xFFD9D9D9),
child:ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: contentList.length,
itemBuilder: (context, index) {
final item = contentList[index];
return CustomContainer(
text: item["text"],
fontSize: item["fontSize"],
color: item["color"],
fontWeight: item["fontWeight"],
height:item["height"],
isBulletPoint: item["isBulletPoint"] ?? false,
textDecoration: item["textDecoration"] ?? TextDecoration.none,
decorationColor: item["decorationColor"],
);
},
),
)
],
),
),
),
);
}
}

View File

@ -0,0 +1,156 @@
import 'package:flutter/material.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/custom_text.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart';
class GettingStarted extends StatelessWidget {
final fcscBanner = Image.asset(
BannerAssetPath.fcsc,
height: 56,
alignment:Alignment.center,
);
final List<Map<String, dynamic>> contentList = [
{
'text': 'This app provides a centralized platform to access key statistical data and insights about the UAE, empoweringusers with accurate and up-to-date information on various sectors.',
'fontSize': 16.0,
'color': Color(0xFF898C81),
'fontWeight': FontWeight.normal,
'isBulletPoint': false,
},
{
'text': 'How to Get Started',
'fontSize': 18.0,
'color': Color(0xFF414042),
'fontWeight': FontWeight.w600,
'isBulletPoint': false,
},
{
'text': '1.Download the app from the App Store or Google Play Store.',
'fontSize': 14.0,
'color': Color(0xFF898C81),
'fontWeight': FontWeight.normal,
'isBulletPoint': false,
},
{
'text': '2.Log in to unlock advanced features or continue as a guest.',
'fontSize': 14.0,
'color': Color(0xFF898C81),
'fontWeight': FontWeight.normal,
'isBulletPoint': false,
},
{
'text': '3.Navigate through categories, explore metrics, and bookmark essential information.',
'fontSize': 14.0,
'color': Color(0xFF898C81),
'fontWeight': FontWeight.normal,
'isBulletPoint': false,
},
{
'text': 'Stay Updated',
'fontSize': 18.0,
'color': Color(0xFF414042),
'fontWeight': FontWeight.bold,
'isBulletPoint': false,
},
{
'text': 'The app regularly updates datasets and features to reflect the latest information. Notifications will alert you about new data or improvements.',
'fontSize': 14.0,
'color': Color(0xFF898C81),
'fontWeight': FontWeight.normal,
'isBulletPoint': false,
},
];
@override
Widget build(BuildContext context) {
return BaseScaffold(title: Text ('Getting Started'),
body: Scrollbar(
thumbVisibility: true,
thickness: 6,
radius: Radius.circular(10),
interactive: true,
child:SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Text(
'WELCOME TO THE FEDERAL COMPETITIVENESS AND STATISTICS CENTRE (FCSC) MOBILE APPLICATION.',
style: TextStyle(
color: Color(0xFF265E84), // Text color
fontSize: 18,
fontWeight: FontWeight.w600
),
),
),
Container(
padding: const EdgeInsets.all(16.0),
color: Color(0xFFD9D9D9),
child:ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: contentList.length,
itemBuilder: (context, index) {
final item = contentList[index];
return CustomContainer(
text: item['text'],
fontSize: item['fontSize']?? 20,
color: item['color'],
fontWeight: item['fontWeight'],
height:item['height'],
isBulletPoint: item['isBulletPoint'] ?? false,
textDecoration: item['textDecoration'] ?? TextDecoration.none,
decorationColor: item['decorationColor'],
);
},
),
),
Container(
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
color: Color(0xFFD9D9D9),
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: 'For more information please visit ',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF265E84),
fontWeight: FontWeight.normal,
),
),
TextSpan(
text: 'www.fcsc.gov.ae',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF568898),
fontWeight: FontWeight.normal,
decoration: TextDecoration.underline,
decorationColor:Color(0xFF568898),
),
),
],
),
),
),
Container(
color: Color(0xFFD9D9D9),
padding: const EdgeInsets.all(16.0),
width: MediaQuery.of(context).size.width,
child: Center( child: fcscBanner,),
),
],
),
),
),
);
}
}

View File

@ -0,0 +1,168 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class UserGuide extends StatefulWidget {
const UserGuide({super.key});
@override
State<UserGuide> createState() => _UserGuideState();
}
class _UserGuideState extends State<UserGuide> {
@override
Widget build(BuildContext context) {
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
child: Row(
mainAxisAlignment: 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(),
),
);
}).toList();
}
return BaseScaffold(
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(0xFF497B8C), 'text': 'Account & Profile', 'icon': Icons.person_outline_rounded, 'index': '2'},
],
[
{'routePath':'features','color': Color(0xFFAA8E83), 'text': 'Using Features', 'icon': Icons.stars_outlined, 'index': '3'},
{'routePath':'features','color': Color(0xFF265E84), 'text': 'Contact', 'icon': Icons.local_phone_outlined, 'index': '4'},
],
[
{'routePath':'faq','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': Icons.question_answer_sharp, 'index': '5'},
// {'routePath':'features','color': Color(0xFF7DAFBC), 'text': 'Advanced Settings', 'icon': Icons.settings_outlined, 'index': '6'},
],
]),
),
),
), );
}
}
class userGuides extends StatelessWidget {
const userGuides({super.key, required this.routePath ,required this.color, required this.text,required this.dynamicIcon,required this.no});
final Color color;
final String text;
final dynamic dynamicIcon;
final String no;
final String routePath;
Widget buildDynamicWidget(dynamic icons) {
if (dynamicIcon is IconData) {
return Icon(
icons,
size: 38,
color: Colors.white,
);
} else if (dynamicIcon is String) {
// Create a Text widget if variable is a String
return Text(
icons,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 20,
color: Colors.white,
),
);
} else {
// Handle unsupported types
return Text(
'Unsupported type',
style: TextStyle(color: Colors.red),
);
}
}
@override
Widget build(BuildContext context) {
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,
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),
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,
),
),
],
),
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

@ -1,10 +1,7 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:pocketbase/pocketbase.dart';
import 'package:share_plus/share_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';
class BaseScaffold extends StatefulWidget {
class BaseScaffold extends StatelessWidget {
final Widget body;
final Widget title;
final List<Widget>? actions;
@ -15,81 +12,9 @@ class BaseScaffold extends StatefulWidget {
required this.title,
this.actions,
}) : super(key: key);
@override
_BaseScaffoldState createState() => _BaseScaffoldState();
}
class _BaseScaffoldState extends State<BaseScaffold> {
final _pb = PocketBase('https://pb.venbait.in');
String _avatarUrl = '';
dynamic userId;
String? userName;
String? userEmail;
String? userAvatar;
String? role;
@override
void initState() {
super.initState();
_checkUserId();
}
// Method to retrieve userId from SharedPreferences
Future<String?> getUserId() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getString('userId'); // Retrieve the userId
}
// Method to check if userId exists and update state
Future<void> _checkUserId() async {
String? fetchedUserId = await getUserId();
if (fetchedUserId != null && fetchedUserId.isNotEmpty) {
setState(() {
userId = fetchedUserId;
});
//print('NAVUser ID: $userId');
_fetchUserData();
} else {
print('No userId found');
// Handle the case where userId is not available
}
}
Future<void> _fetchUserData() async {
try {
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',
},
);
print('NAVuserDetails: $userDetailsResponse');
setState(() {
userName = userDetailsResponse.data['username'] ?? '';
userEmail = userDetailsResponse.data['email'] ?? '';
userAvatar = userDetailsResponse.data['avatar'] ?? '';
role = userDetailsResponse.data['role'] ?? '';
String recordId = userId;
String collectionId =
userDetailsResponse.data['collectionId'] ?? '_pb_users_auth_';
if (userAvatar!.isNotEmpty && recordId.isNotEmpty) {
_avatarUrl =
'https://pb.venbait.in/api/files/$collectionId/$recordId/$userAvatar';
} else {
_avatarUrl = ''; // Reset to default or empty
}
});
} catch (e) {
print('Error fetching user details: $e');
}
}
// final Widget body;
//
// const BaseScaffold({required this.body});
@override
Widget build(BuildContext context) {
@ -97,29 +22,15 @@ class _BaseScaffoldState extends State<BaseScaffold> {
String currentRoute = GoRouterState.of(context).matchedLocation;
double myheight = MediaQuery.of(context).size.height;
double mywidth = MediaQuery.of(context).size.width;
return Scaffold(
appBar: AppBar(
title: widget.title,
actions: [
// IconButton(
// onPressed: () {
// // Share logic here
// print("Share icon pressed");
// Share.share(
// 'Open the app: fcscapp://home\n\n'
// 'If you dont have the app installed, '
// 'visit: http://localhost:65493');
// },
// icon: Icon(Icons.share),
// ),
IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)),
],
),
appBar: AppBar(title: title, actions: [
IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)),
]),
drawer: Drawer(
child: ListView(
children: [
DrawerHeader(
//decoration: BoxDecoration(color: Colors.blue),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
@ -137,39 +48,18 @@ class _BaseScaffoldState extends State<BaseScaffold> {
child: Row(
children: [
SizedBox(
width: mywidth / 8,
height: mywidth / 8,
child: ClipOval(
child: _avatarUrl.isNotEmpty
? Image(
image: NetworkImage(_avatarUrl),
fit: BoxFit.cover,
width: double.infinity,
height: double.infinity,
)
: Image(
image: AssetImage(
'assets/edit_profile/profile.png'),
fit: BoxFit.cover,
width: double.infinity,
height: double.infinity,
),
),
//child: Image(image: AssetImage('assets/edit_profile/profile.png'))
),
width: mywidth / 8,
child: Image(
image: AssetImage(
'assets/edit_profile/profile.png'))),
SizedBox(
width: mywidth / 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Text(userId ?? 'Loading user...'), // Display userId here
// Text('Mohammad@fcsc.com')
Text(userName ?? 'Loading...'),
Text(
userEmail ?? 'Loading...',
style: TextStyle(fontSize: 12),
),
Text('Mohammad'),
Text('Mohammad@fcsc.com')
],
)
],
@ -178,35 +68,33 @@ class _BaseScaffoldState extends State<BaseScaffold> {
],
),
),
if (role != 'admin')
ListTile(
leading: SizedBox(
height: myheight / 15,
width: mywidth / 15,
child: Image(
image: AssetImage('assets/icons/drawer/message.png'))),
title: Text('Feedback'),
onTap: () => context.go('/feedback'),
),
if (role == 'admin')
ListTile(
leading: SizedBox(
height: myheight / 15,
width: mywidth / 15,
child: Image(
image:
AssetImage('assets/icons/drawer/manageuser.png'))),
title: Text('Manage User'),
onTap: () => context.go('/manageuser'),
),
ListTile(
leading: SizedBox(
height: myheight / 15,
width: mywidth / 15,
child: Image(
image: AssetImage('assets/icons/drawer/logout.png'))),
title: Text('Logout'),
onTap: () => context.go('/'),
image: AssetImage('assets/icons/drawer/message.png'))),
title: Text('Feedback'),
onTap: () => context.go('/feedback'),
),
ListTile(
leading: SizedBox(
height: myheight / 15,
width: mywidth / 15,
child: Image(
image: AssetImage('assets/icons/drawer/manageuser.png'))),
title: Text('Manage User'),
onTap: () => context.go('/manageuser'),
),
ListTile(
leading: SizedBox(
height: myheight / 15,
width: mywidth / 15,
child: Image(
image: AssetImage('assets/icons/drawer/book.png'))),
title: Text('User Guide'),
onTap: () => context.go('/user-guide'),
),
],
),
@ -252,40 +140,40 @@ class _BaseScaffoldState extends State<BaseScaffold> {
unselectedItemColor: Colors.grey,
showUnselectedLabels: true,
),
body: widget.body,
body: body,
);
}
// Map the current route to the selected index
//Map the current route to the selected index
int _getSelectedIndex(String route) {
switch (route) {
case '/myhomepage':
case '/':
return 0;
case '/about':
case '/uaenumbers':
return 1;
case '/settings':
case '/competitiveness':
return 2;
case '/profile':
case '/countryprofile':
return 3;
default:
return 0;
}
}
// Handle navigation when an item is tapped
//Handle navigation when an item is tapped
void _onItemTapped(BuildContext context, int index) {
switch (index) {
case 0:
context.go('/myhomepage');
context.go('/');
break;
case 1:
context.go('/about');
context.go('/uaenumbers');
break;
case 2:
context.go('/settings');
context.go('/competitiveness');
break;
case 3:
context.go('/profile');
context.go('/countryprofile');
break;
}
}

View File

@ -5,23 +5,23 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
url: "https://pub.dev"
source: hosted
version: "72.0.0"
version: "76.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.2"
version: "0.3.3"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
url: "https://pub.dev"
source: hosted
version: "6.7.0"
version: "6.11.0"
analyzer_plugin:
dependency: transitive
description:
@ -130,10 +130,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb
sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2"
url: "https://pub.dev"
source: hosted
version: "8.9.2"
version: "8.9.3"
characters:
dependency: transitive
description:
@ -186,10 +186,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
convert:
dependency: transitive
description:
@ -266,10 +266,10 @@ packages:
dependency: transitive
description:
name: custom_lint_visitor
sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d"
sha256: bfe9b7a09c4775a587b58d10ebb871d4fe618237639b1e84d5ec62d7dfef25f9
url: "https://pub.dev"
source: hosted
version: "1.0.0+6.7.0"
version: "1.0.0+6.11.0"
dart_style:
dependency: transitive
description:
@ -443,10 +443,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398"
sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e"
url: "https://pub.dev"
source: hosted
version: "2.0.23"
version: "2.0.24"
flutter_rating_bar:
dependency: "direct main"
description:
@ -525,10 +525,10 @@ packages:
dependency: "direct main"
description:
name: fluttertoast
sha256: "95f349437aeebe524ef7d6c9bde3e6b4772717cf46a0eb6a3ceaddc740b297cc"
sha256: "24467dc20bbe49fd63e57d8e190798c4d22cbbdac30e54209d153a15273721d1"
url: "https://pub.dev"
source: hosted
version: "8.2.8"
version: "8.2.10"
freezed:
dependency: "direct dev"
description:
@ -557,10 +557,10 @@ packages:
dependency: "direct main"
description:
name: get_it
sha256: c49895c1ecb0ee2a0ec568d39de882e2c299ba26355aa6744ab1001f98cebd15
sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103
url: "https://pub.dev"
source: hosted
version: "8.0.2"
version: "8.0.3"
glob:
dependency: transitive
description:
@ -621,10 +621,10 @@ packages:
dependency: transitive
description:
name: http_multi_server
sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b"
sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
url: "https://pub.dev"
source: hosted
version: "3.2.1"
version: "3.2.2"
http_parser:
dependency: transitive
description:
@ -653,10 +653,10 @@ packages:
dependency: transitive
description:
name: image_picker_android
sha256: fa8141602fde3f7e2f81dbf043613eb44dfa325fa0bcf93c0f142c9f7a2c193e
sha256: aa6f1280b670861ac45220cc95adc59bb6ae130259d36f980ccb62220dc5e59f
url: "https://pub.dev"
source: hosted
version: "0.8.12+18"
version: "0.8.12+19"
image_picker_for_web:
dependency: transitive
description:
@ -773,18 +773,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
@ -813,10 +813,10 @@ packages:
dependency: transitive
description:
name: macros
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev"
source: hosted
version: "0.1.2-main.4"
version: "0.1.3-main.0"
mailer:
dependency: "direct main"
description:
@ -845,10 +845,10 @@ packages:
dependency: "direct main"
description:
name: material_charts
sha256: "3950a910eeb8f5dca7040a68d526a086a9512f87da5c2b172495a5fcab0f6dc3"
sha256: ada5af96e9cdd9888c1931eaf307e6693408584ca0de1b1c795f9862590f9fcf
url: "https://pub.dev"
source: hosted
version: "0.0.23"
version: "0.0.25"
material_color_utilities:
dependency: transitive
description:
@ -1005,10 +1005,10 @@ packages:
dependency: transitive
description:
name: pubspec_parse
sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.4.0"
recase:
dependency: transitive
description:
@ -1084,42 +1084,42 @@ packages:
dependency: "direct main"
description:
name: share_plus
sha256: "9c9bafd4060728d7cdb2464c341743adbd79d327cb067ec7afb64583540b47c8"
sha256: "6327c3f233729374d0abaafd61f6846115b2a481b4feddd8534211dc10659400"
url: "https://pub.dev"
source: hosted
version: "10.1.2"
version: "10.1.3"
share_plus_platform_interface:
dependency: transitive
description:
name: share_plus_platform_interface
sha256: c57c0bbfec7142e3a0f55633be504b796af72e60e3c791b44d5a017b985f7a48
sha256: cc012a23fc2d479854e6c80150696c4a5f5bb62cb89af4de1c505cf78d0a5d0b
url: "https://pub.dev"
source: hosted
version: "5.0.1"
version: "5.0.2"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82"
sha256: "3c7e73920c694a436afaf65ab60ce3453d91f84208d761fbd83fc21182134d93"
url: "https://pub.dev"
source: hosted
version: "2.3.3"
version: "2.3.4"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
sha256: "7f172d1b06de5da47b6264c2692ee2ead20bbbc246690427cdb4fc301cd0c549"
sha256: "02a7d8a9ef346c9af715811b01fbd8e27845ad2c41148eefd31321471b41863d"
url: "https://pub.dev"
source: hosted
version: "2.3.4"
version: "2.4.0"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d"
sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03"
url: "https://pub.dev"
source: hosted
version: "2.5.3"
version: "2.5.4"
shared_preferences_linux:
dependency: transitive
description:
@ -1172,7 +1172,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
smart_api_client:
dependency: "direct main"
description:
@ -1192,10 +1192,10 @@ packages:
dependency: transitive
description:
name: source_helper
sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd"
sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c"
url: "https://pub.dev"
source: hosted
version: "1.3.4"
version: "1.3.5"
source_span:
dependency: transitive
description:
@ -1216,10 +1216,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.0"
state_notifier:
dependency: transitive
description:
@ -1240,18 +1240,18 @@ packages:
dependency: transitive
description:
name: stream_transform
sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f"
sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
syncfusion_flutter_charts:
dependency: "direct main"
description:
@ -1280,10 +1280,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.3"
the_validator:
dependency: "direct main"
description:
@ -1408,18 +1408,18 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.3.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
web:
dependency: transitive
description:
@ -1456,10 +1456,10 @@ packages:
dependency: transitive
description:
name: webview_flutter_android
sha256: "285cedfd9441267f6cca8843458620b5fda1af75b04f5818d0441acda5d7df19"
sha256: "3d535126f7244871542b2f0b0fcf94629c9a14883250461f9abe1a6644c1c379"
url: "https://pub.dev"
source: hosted
version: "4.1.0"
version: "4.2.0"
webview_flutter_platform_interface:
dependency: transitive
description:
@ -1504,10 +1504,10 @@ packages:
dependency: transitive
description:
name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
url: "https://pub.dev"
source: hosted
version: "3.1.2"
version: "3.1.3"
sdks:
dart: ">=3.5.2 <4.0.0"
flutter: ">=3.24.0"

View File

@ -54,7 +54,7 @@ dependencies:
provider: ^6.1.2
mailer: ^6.2.0
image_picker: ^1.1.2
syncfusion_flutter_charts: ^28.1.33
syncfusion_flutter_charts: 28.1.33
material_charts: ^0.0.23
dependency_overrides: