Marriage card Implemented
This commit is contained in:
parent
d84a438c0f
commit
3b038f7b42
@ -294,9 +294,10 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.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/Competitiveness/competitiveness.dart';
|
||||||
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/country_profile.dart';
|
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
|
||||||
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/uae_numbers.dart';
|
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/UAE_Numbers/Social/marriages.dart';
|
||||||
|
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/UAE_Numbers/uae_numbers.dart';
|
||||||
import 'package:uae_stat/presentation/Screens/auth_verification/registration.dart';
|
import 'package:uae_stat/presentation/Screens/auth_verification/registration.dart';
|
||||||
import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/getting_started.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 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
|
||||||
@ -426,5 +427,11 @@ final GoRouter router = GoRouter(
|
|||||||
builder: (context, state) => CountryProfile(),
|
builder: (context, state) => CountryProfile(),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
|
// UAE NUMBER Routes
|
||||||
|
GoRoute(
|
||||||
|
path: '/marriages',
|
||||||
|
builder: (context, state) => Marriages(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -0,0 +1,142 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
|
||||||
|
import 'package:fl_chart/fl_chart.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 HorizontalBarChart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class HorizontalBarChart extends StatelessWidget {
|
||||||
|
final List<String> xAxisData = ['2019', '2020', '2021', '2022', '2023'];
|
||||||
|
final List<double> yAxisData = [2, 4, 1, 5, 3];
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
double myheight = MediaQuery.of(context).size.height;
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(title: Text('Horizontal Bar Chart')),
|
||||||
|
body: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child:
|
||||||
|
Container(
|
||||||
|
height: myheight/4,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black12,
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child:
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 16,left: 8.0,right: 8.0,bottom: 8.0),
|
||||||
|
child: BarChart(
|
||||||
|
BarChartData(
|
||||||
|
alignment: BarChartAlignment.spaceAround,
|
||||||
|
maxY: 8,
|
||||||
|
barTouchData: BarTouchData(enabled: false),
|
||||||
|
titlesData: FlTitlesData(
|
||||||
|
leftTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
interval: 2,
|
||||||
|
getTitlesWidget: (value, meta) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 8.0),
|
||||||
|
child: Text('${value.toInt()}K'),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
reservedSize: 60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTitlesWidget: (value, meta) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
|
child: Text(xAxisData[value.toInt()]),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
reservedSize: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
topTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(showTitles: false), // Hides top titles
|
||||||
|
),
|
||||||
|
rightTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(showTitles: false), // Hides right titles
|
||||||
|
),
|
||||||
|
),
|
||||||
|
gridData: FlGridData(show: false),
|
||||||
|
borderData: FlBorderData(show: false),
|
||||||
|
barGroups: List.generate(
|
||||||
|
xAxisData.length,
|
||||||
|
(index) => BarChartGroupData(
|
||||||
|
x: index,
|
||||||
|
barRods: [
|
||||||
|
BarChartRodData(
|
||||||
|
toY: yAxisData[index],
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
//colors: [Colors.blueAccent],
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
runApp(MaterialApp(home: HorizontalBarChart()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// void main() {
|
||||||
|
// runApp(MaterialApp(home: HorizontalBarChart()));
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,266 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:uae_stat/presentation/components/constant/constant.dart';
|
||||||
|
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
|
||||||
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class Marriages extends StatelessWidget {
|
||||||
|
const Marriages({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
double myheight = MediaQuery.of(context).size.height;
|
||||||
|
double mywidth = MediaQuery.of(context).size.width;
|
||||||
|
final List<String> xAxisData = ['2019', '2020', '2021', '2022', '2023'];
|
||||||
|
final List<double> yAxisData = [2, 4, 1, 5, 3];
|
||||||
|
return BaseScaffold(
|
||||||
|
//appbarActions: IconButton(onPressed: (){}, icon: Icon(Icons.arrow_back_ios_new)),
|
||||||
|
appbarColor: Color(0xFFC6BEB2),
|
||||||
|
title: Text("UAE Numbers",style: TextStyle(color: Colors.white,fontWeight: FontWeight.bold),),
|
||||||
|
showBackButton: true,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children : [
|
||||||
|
Container(
|
||||||
|
height: myheight/4.5,
|
||||||
|
width: double.infinity,
|
||||||
|
color: Color(0xFFC6BEB2),
|
||||||
|
child: Padding(padding: EdgeInsets.only(left: 30,right: 30,top: 20,bottom: 10),child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text("SOCIAL",style: TextStyle(color: Colors.white,fontSize: 30),),
|
||||||
|
Container(width: mywidth/5,child: Divider(thickness: 10,color: Colors.white,)),
|
||||||
|
Text("Marriages",style: TextStyle(color: Colors.white,fontSize: 20),),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
IconButton(onPressed: (){}, icon: Icon(Icons.bookmark_add_outlined,color: Colors.white,size: 40,)),
|
||||||
|
IconButton(onPressed: (){}, icon: Icon(Icons.share,color: Colors.white,size: 30,)),
|
||||||
|
],),
|
||||||
|
],
|
||||||
|
),)
|
||||||
|
),
|
||||||
|
SingleChildScrollView(child: Container(
|
||||||
|
height: myheight,
|
||||||
|
color: Color(0xFFC6BEB2),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 0.0,left: 10,right: 10,bottom: 20),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Container(height: myheight/3.5,width: mywidth/2.5,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10))
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'assets/icons/indicator/social/marriage.png',
|
||||||
|
height: myheight / 10, // This ensures the image fits within the container's height
|
||||||
|
width: myheight / 10, // You can adjust the size as needed
|
||||||
|
),
|
||||||
|
Text("Total",style: TextStyle(fontWeight: FontWeight.bold,fontSize: 26),),
|
||||||
|
Text("2022",style: TextStyle(fontSize: 15,color: Colors.grey),),
|
||||||
|
Text("16759",style: TextStyle(fontSize: 26,fontWeight: FontWeight.bold,color: socialColor),),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(height: myheight/3.5,width: mywidth/2.5,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10))
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'assets/icons/indicator/social/marriage.png',
|
||||||
|
height: myheight / 10, // This ensures the image fits within the container's height
|
||||||
|
width: myheight / 10, // You can adjust the size as needed
|
||||||
|
),
|
||||||
|
Text("Average",style: TextStyle(fontWeight: FontWeight.bold,fontSize: 26),),
|
||||||
|
Text("(2021 - 2022)",style: TextStyle(fontSize: 15,color: Colors.grey),),
|
||||||
|
Text("15987",style: TextStyle(fontSize: 26,fontWeight: FontWeight.bold,color: socialColor),),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: myheight/20,),
|
||||||
|
Container(
|
||||||
|
height: myheight/2,
|
||||||
|
width: mywidth/1.2,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10))
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(10.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(height: myheight/30,),
|
||||||
|
Center(child: Text("Total Marriages by Marriage Type",style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),),
|
||||||
|
),
|
||||||
|
SizedBox(height: myheight/30,),
|
||||||
|
Container(
|
||||||
|
height: myheight/4,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black12,
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child:
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 16,left: 8.0,right: 8.0,bottom: 8.0),
|
||||||
|
child: BarChart(
|
||||||
|
BarChartData(
|
||||||
|
alignment: BarChartAlignment.spaceAround,
|
||||||
|
maxY: 8,
|
||||||
|
barTouchData: BarTouchData(enabled: false),
|
||||||
|
titlesData: FlTitlesData(
|
||||||
|
leftTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
interval: 2,
|
||||||
|
getTitlesWidget: (value, meta) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 8.0),
|
||||||
|
child: Text('${value.toInt()}K'),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
reservedSize: 60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTitlesWidget: (value, meta) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
|
child: Text(xAxisData[value.toInt()]),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
reservedSize: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
topTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(showTitles: false), // Hides top titles
|
||||||
|
),
|
||||||
|
rightTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(showTitles: false), // Hides right titles
|
||||||
|
),
|
||||||
|
),
|
||||||
|
gridData: FlGridData(show: false),
|
||||||
|
borderData: FlBorderData(show: false),
|
||||||
|
barGroups: List.generate(
|
||||||
|
xAxisData.length,
|
||||||
|
(index) => BarChartGroupData(
|
||||||
|
x: index,
|
||||||
|
barRods: [
|
||||||
|
BarChartRodData(
|
||||||
|
toY: yAxisData[index],
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
//colors: [Colors.blueAccent],
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Container(
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: Colors.white,
|
||||||
|
// borderRadius: BorderRadius.circular(12),
|
||||||
|
// boxShadow: [
|
||||||
|
// BoxShadow(
|
||||||
|
// color: Colors.black12,
|
||||||
|
// blurRadius: 8,
|
||||||
|
// offset: Offset(0, 4),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// child:
|
||||||
|
// BarChart(
|
||||||
|
// BarChartData(
|
||||||
|
// alignment: BarChartAlignment.spaceAround,
|
||||||
|
// maxY: 20,
|
||||||
|
// barTouchData: BarTouchData(enabled: false),
|
||||||
|
// titlesData: FlTitlesData(
|
||||||
|
// leftTitles: AxisTitles(
|
||||||
|
// sideTitles: SideTitles(
|
||||||
|
// showTitles: true,
|
||||||
|
// getTitlesWidget: (value, meta) {
|
||||||
|
// return Padding(
|
||||||
|
// padding: const EdgeInsets.only(right: 8.0),
|
||||||
|
// child: Text('${value.toInt()}K'),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// reservedSize: 40,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// bottomTitles: AxisTitles(
|
||||||
|
// sideTitles: SideTitles(
|
||||||
|
// showTitles: true,
|
||||||
|
// getTitlesWidget: (value, meta) {
|
||||||
|
// return Padding(
|
||||||
|
// padding: const EdgeInsets.only(top: 8.0),
|
||||||
|
// child: Text(xAxisData[value.toInt()]),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// reservedSize: 40,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// gridData: FlGridData(show: false),
|
||||||
|
// borderData: FlBorderData(show: false),
|
||||||
|
// barGroups: List.generate(
|
||||||
|
// xAxisData.length,
|
||||||
|
// (index) => BarChartGroupData(
|
||||||
|
// x: index,
|
||||||
|
// barRods: [
|
||||||
|
// BarChartRodData(
|
||||||
|
// toY: yAxisData[index],
|
||||||
|
// color: Colors.blueAccent,
|
||||||
|
// //colors: [Colors.blueAccent],
|
||||||
|
// borderRadius: BorderRadius.circular(4),
|
||||||
|
// width: 20,
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
|
),)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
), mycenterTitle: false,
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:uae_stat/presentation/routes/bottom_bar_routes/tab_routes/home_route.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/routes/drawer_routes/custom_drawer_routes.dart';
|
||||||
import 'package:uae_stat/presentation/components/constant/constant.dart';
|
import 'package:uae_stat/presentation/components/constant/constant.dart';
|
||||||
@ -16,7 +17,7 @@ class UaeNumbers extends StatelessWidget {
|
|||||||
body:
|
body:
|
||||||
//EconomicDashboard(),
|
//EconomicDashboard(),
|
||||||
//EconomyExpandTile()
|
//EconomyExpandTile()
|
||||||
uaenumberWidget());
|
uaenumberWidget(),);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,8 +84,10 @@ class uaenumberWidget extends StatelessWidget {
|
|||||||
]),
|
]),
|
||||||
buildCategoryTitle('Vital Statistics',socialColor),
|
buildCategoryTitle('Vital Statistics',socialColor),
|
||||||
buildCardRow([
|
buildCardRow([
|
||||||
buildCard(context,'Marriages', '96%', '2023',socialColor,socialColor,mywidth/2.5),
|
InkWell(onTap : (){
|
||||||
buildCard(context,'Divorces', '1.2K', '2024',socialColor,socialColor,mywidth/2.5),
|
context.go('/marriages');
|
||||||
|
},child: buildCard(context,'Marriages', '96%', '2023',socialColor,socialColor,mywidth/2.5)),
|
||||||
|
InkWell(onTap : (){},child: buildCard(context,'Divorces', '1.2K', '2024',socialColor,socialColor,mywidth/2.5)),
|
||||||
]),
|
]),
|
||||||
buildCategoryTitle('Education',socialColor),
|
buildCategoryTitle('Education',socialColor),
|
||||||
buildCardRow([
|
buildCardRow([
|
||||||
@ -265,21 +268,22 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
|||||||
duration: Duration(milliseconds: 300),
|
duration: Duration(milliseconds: 300),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: isExpanded ? myheight : 0,
|
|
||||||
child: isExpanded
|
child: isExpanded
|
||||||
? SingleChildScrollView(
|
? IntrinsicHeight(
|
||||||
child: Container(
|
child: IntrinsicWidth(
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Colors.white,
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20))
|
color: Colors.white,
|
||||||
),
|
borderRadius: BorderRadius.all(Radius.circular(20))
|
||||||
|
),
|
||||||
|
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: widget.children,
|
children: widget.children,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1,31 +0,0 @@
|
|||||||
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"),);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -177,11 +177,11 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
double myheight = MediaQuery.of(context).size.height;
|
double myheight = MediaQuery.of(context).size.height;
|
||||||
double mywidth = MediaQuery.of(context).size.width;
|
double mywidth = MediaQuery.of(context).size.width;
|
||||||
return BaseScaffold(
|
return BaseScaffold(
|
||||||
title: Center(
|
mycenterTitle: true,
|
||||||
child: SizedBox(
|
title: SizedBox(
|
||||||
height: myheight / 5,
|
height: myheight / 5,
|
||||||
width: mywidth / 3,
|
width: mywidth / 3,
|
||||||
child: Image(image: AssetImage('assets/logos/uae_stat.png')))),
|
child: Image(image: AssetImage('assets/logos/uae_stat.png'))),
|
||||||
body: EconomyStats(),
|
body: EconomyStats(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,215 @@
|
|||||||
|
// import 'package:flutter/material.dart';
|
||||||
|
// import 'package:go_router/go_router.dart';
|
||||||
|
//
|
||||||
|
// class BaseScaffold extends StatelessWidget {
|
||||||
|
// final Widget body;
|
||||||
|
// final Widget title;
|
||||||
|
// final Widget? appbarActions;
|
||||||
|
// final List<Widget>? actions;
|
||||||
|
// final Color? appbarColor,mytitleColor;
|
||||||
|
//
|
||||||
|
// const BaseScaffold({
|
||||||
|
// Key? key,
|
||||||
|
// required this.body,
|
||||||
|
// required this.title,
|
||||||
|
// this.actions,
|
||||||
|
// this.appbarColor,
|
||||||
|
// this.mytitleColor,
|
||||||
|
// this.appbarActions
|
||||||
|
// }) : super(key: key);
|
||||||
|
// // final Widget body;
|
||||||
|
// //
|
||||||
|
// // const BaseScaffold({required this.body});
|
||||||
|
//
|
||||||
|
// @override
|
||||||
|
// Widget build(BuildContext context) {
|
||||||
|
// // Get the current route to highlight the active item
|
||||||
|
// 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: title,backgroundColor: appbarColor, actions: [
|
||||||
|
// IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)),
|
||||||
|
// ],
|
||||||
|
// leading: appbarActions,
|
||||||
|
//
|
||||||
|
// ),
|
||||||
|
//
|
||||||
|
// drawer: Drawer(
|
||||||
|
// child: ListView(
|
||||||
|
// children: [
|
||||||
|
// DrawerHeader(
|
||||||
|
// //decoration: BoxDecoration(color: Colors.blue),
|
||||||
|
// child: Column(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
// children: [
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// SizedBox(
|
||||||
|
// width: mywidth / 8,
|
||||||
|
// child: Image(
|
||||||
|
// image: AssetImage('assets/logos/fcsc.png'))),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// Divider(),
|
||||||
|
// InkWell(
|
||||||
|
// onTap: () => context.go('/editProfile'),
|
||||||
|
// child: Row(
|
||||||
|
// children: [
|
||||||
|
// SizedBox(
|
||||||
|
// width: mywidth / 8,
|
||||||
|
// child: Image(
|
||||||
|
// image: AssetImage(
|
||||||
|
// 'assets/edit_profile/profile.png'))),
|
||||||
|
// SizedBox(
|
||||||
|
// width: mywidth / 20,
|
||||||
|
// ),
|
||||||
|
// Column(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// Text('Mohammad'),
|
||||||
|
// Text('Mohammad@fcsc.com')
|
||||||
|
// ],
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// 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'),
|
||||||
|
// ),
|
||||||
|
// 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'),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// bottomNavigationBar: BottomNavigationBar(
|
||||||
|
// currentIndex: _getSelectedIndex(currentRoute),
|
||||||
|
// onTap: (index) => _onItemTapped(context, index),
|
||||||
|
// type: BottomNavigationBarType.fixed,
|
||||||
|
// items: [
|
||||||
|
// BottomNavigationBarItem(
|
||||||
|
// icon: SizedBox(
|
||||||
|
// height: myheight / 15,
|
||||||
|
// width: mywidth / 15,
|
||||||
|
// child: Image(
|
||||||
|
// image: AssetImage('assets/icons/bottom_bar/home.png'))),
|
||||||
|
// label: 'Home',
|
||||||
|
// ),
|
||||||
|
// BottomNavigationBarItem(
|
||||||
|
// icon: SizedBox(
|
||||||
|
// height: myheight / 15,
|
||||||
|
// width: mywidth / 15,
|
||||||
|
// child: Image(
|
||||||
|
// image: AssetImage('assets/icons/bottom_bar/uae_map.png'))),
|
||||||
|
// label: 'UAE Numbers',
|
||||||
|
// ),
|
||||||
|
// BottomNavigationBarItem(
|
||||||
|
// icon: SizedBox(
|
||||||
|
// height: myheight / 15,
|
||||||
|
// width: mywidth / 15,
|
||||||
|
// child: Image(
|
||||||
|
// image:
|
||||||
|
// AssetImage('assets/icons/bottom_bar/ranking.png'))),
|
||||||
|
// label: 'Competitiveness'),
|
||||||
|
// BottomNavigationBarItem(
|
||||||
|
// icon: SizedBox(
|
||||||
|
// height: myheight / 15,
|
||||||
|
// width: mywidth / 15,
|
||||||
|
// child: Image(
|
||||||
|
// image: AssetImage('assets/icons/bottom_bar/globe.png'))),
|
||||||
|
// label: 'Country Profile'),
|
||||||
|
// ],
|
||||||
|
// selectedItemColor: Colors.black,
|
||||||
|
// unselectedItemColor: Colors.grey,
|
||||||
|
// showUnselectedLabels: true,
|
||||||
|
// ),
|
||||||
|
// body: body,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //Map the current route to the selected index
|
||||||
|
// int _getSelectedIndex(String route) {
|
||||||
|
// switch (route) {
|
||||||
|
// case '/':
|
||||||
|
// return 0;
|
||||||
|
// case '/uaenumbers':
|
||||||
|
// return 1;
|
||||||
|
// case '/competitiveness':
|
||||||
|
// return 2;
|
||||||
|
// case '/countryprofile':
|
||||||
|
// return 3;
|
||||||
|
// default:
|
||||||
|
// return 0;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //Handle navigation when an item is tapped
|
||||||
|
// void _onItemTapped(BuildContext context, int index) {
|
||||||
|
// switch (index) {
|
||||||
|
// case 0:
|
||||||
|
// context.go('/');
|
||||||
|
// break;
|
||||||
|
// case 1:
|
||||||
|
// context.go('/uaenumbers');
|
||||||
|
// break;
|
||||||
|
// case 2:
|
||||||
|
// context.go('/competitiveness');
|
||||||
|
// break;
|
||||||
|
// case 3:
|
||||||
|
// context.go('/countryprofile');
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
class BaseScaffold extends StatelessWidget {
|
class BaseScaffold extends StatelessWidget {
|
||||||
final Widget body;
|
final Widget body;
|
||||||
final Widget title;
|
final Widget title;
|
||||||
|
final bool? mycenterTitle;
|
||||||
|
final bool showBackButton;
|
||||||
final List<Widget>? actions;
|
final List<Widget>? actions;
|
||||||
|
final Color? appbarColor, mytitleColor;
|
||||||
|
|
||||||
const BaseScaffold({
|
const BaseScaffold({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.body,
|
required this.body,
|
||||||
required this.title,
|
required this.title,
|
||||||
this.actions,
|
this.actions,
|
||||||
|
this.appbarColor,
|
||||||
|
this.mytitleColor,
|
||||||
|
this.showBackButton = false, this.mycenterTitle = false, // Default is to show the drawer icon
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
// final Widget body;
|
|
||||||
//
|
|
||||||
// const BaseScaffold({required this.body});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -23,76 +218,105 @@ class BaseScaffold extends StatelessWidget {
|
|||||||
double myheight = MediaQuery.of(context).size.height;
|
double myheight = MediaQuery.of(context).size.height;
|
||||||
double mywidth = MediaQuery.of(context).size.width;
|
double mywidth = MediaQuery.of(context).size.width;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: title, actions: [
|
appBar: AppBar(
|
||||||
IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)),
|
centerTitle: mycenterTitle,
|
||||||
]),
|
title: title,
|
||||||
|
backgroundColor: appbarColor,
|
||||||
|
leading:
|
||||||
|
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
|
||||||
|
// Show the back button if showBackButton is true, otherwise show the drawer menu
|
||||||
|
if (showBackButton)
|
||||||
|
Positioned(
|
||||||
|
left: 20,
|
||||||
|
child: IconButton(
|
||||||
|
color: Colors.white,
|
||||||
|
icon: Icon(Icons.arrow_back_ios_new),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Show the drawer icon in all cases
|
||||||
|
Positioned(
|
||||||
|
right: 10,
|
||||||
|
child: Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return IconButton(
|
||||||
|
color: showBackButton ? Colors.white : Colors.black,
|
||||||
|
icon: Icon(Icons.menu),
|
||||||
|
onPressed: () {
|
||||||
|
// Open the drawer using the Scaffold context
|
||||||
|
Scaffold.of(context).openDrawer();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
actions: actions,
|
||||||
|
),
|
||||||
drawer: Drawer(
|
drawer: Drawer(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
DrawerHeader(
|
DrawerHeader(
|
||||||
//decoration: BoxDecoration(color: Colors.blue),
|
child: Container(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
SizedBox(
|
||||||
children: [
|
width: mywidth/5,
|
||||||
SizedBox(
|
height: myheight/15,
|
||||||
width: mywidth / 8,
|
child: Image.asset('assets/logos/fcsc.png')),
|
||||||
child: Image(
|
|
||||||
image: AssetImage('assets/logos/fcsc.png'))),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Divider(),
|
Divider(),
|
||||||
InkWell(
|
SizedBox(
|
||||||
onTap: () => context.go('/editProfile'),
|
height: myheight/15,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min, // Ensures the row only takes up as much space as its children need
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
// The profile image with fixed size
|
||||||
width: mywidth / 8,
|
Image.asset(
|
||||||
child: Image(
|
'assets/edit_profile/profile.png',
|
||||||
image: AssetImage(
|
height: myheight / 10, // This ensures the image fits within the container's height
|
||||||
'assets/edit_profile/profile.png'))),
|
width: myheight / 10, // You can adjust the size as needed
|
||||||
SizedBox(
|
),
|
||||||
width: mywidth / 20,
|
|
||||||
|
// Wrapping the Column in Flexible to ensure no overflow
|
||||||
|
Flexible(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text('Mohammad'),
|
||||||
|
Text('Mohammad@fcsc.com'),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text('Mohammad'),
|
|
||||||
Text('Mohammad@fcsc.com')
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
|
),),
|
||||||
|
|
||||||
),
|
),
|
||||||
|
SizedBox(height: myheight/60,),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: SizedBox(
|
leading: Icon(Icons.feedback),
|
||||||
height: myheight / 15,
|
|
||||||
width: mywidth / 15,
|
|
||||||
child: Image(
|
|
||||||
image: AssetImage('assets/icons/drawer/message.png'))),
|
|
||||||
title: Text('Feedback'),
|
title: Text('Feedback'),
|
||||||
onTap: () => context.go('/feedback'),
|
onTap: () => context.go('/feedback'),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: SizedBox(
|
leading: Icon(Icons.people),
|
||||||
height: myheight / 15,
|
|
||||||
width: mywidth / 15,
|
|
||||||
child: Image(
|
|
||||||
image: AssetImage('assets/icons/drawer/manageuser.png'))),
|
|
||||||
title: Text('Manage User'),
|
title: Text('Manage User'),
|
||||||
onTap: () => context.go('/manageuser'),
|
onTap: () => context.go('/manageuser'),
|
||||||
),
|
),
|
||||||
|
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: SizedBox(
|
leading: Icon(Icons.book),
|
||||||
height: myheight / 15,
|
|
||||||
width: mywidth / 15,
|
|
||||||
child: Image(
|
|
||||||
image: AssetImage('assets/icons/drawer/book.png'))),
|
|
||||||
title: Text('User Guide'),
|
title: Text('User Guide'),
|
||||||
onTap: () => context.go('/user-guide'),
|
onTap: () => context.go('/user-guide'),
|
||||||
),
|
),
|
||||||
@ -126,7 +350,7 @@ class BaseScaffold extends StatelessWidget {
|
|||||||
width: mywidth / 15,
|
width: mywidth / 15,
|
||||||
child: Image(
|
child: Image(
|
||||||
image:
|
image:
|
||||||
AssetImage('assets/icons/bottom_bar/ranking.png'))),
|
AssetImage('assets/icons/bottom_bar/ranking.png'))),
|
||||||
label: 'Competitiveness'),
|
label: 'Competitiveness'),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: SizedBox(
|
icon: SizedBox(
|
||||||
@ -143,7 +367,6 @@ class BaseScaffold extends StatelessWidget {
|
|||||||
body: body,
|
body: body,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Map the current route to the selected index
|
//Map the current route to the selected index
|
||||||
int _getSelectedIndex(String route) {
|
int _getSelectedIndex(String route) {
|
||||||
switch (route) {
|
switch (route) {
|
||||||
@ -178,3 +401,5 @@ class BaseScaffold extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -385,10 +385,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: fl_chart
|
name: fl_chart
|
||||||
sha256: "74959b99b92b9eebeed1a4049426fd67c4abc3c5a0f4d12e2877097d6a11ae08"
|
sha256: "10ddaf334fe84d59333a12d153043e366f243e0bdfff2df0313e1e249f5bf926"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.69.2"
|
version: "0.70.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|||||||
@ -20,7 +20,7 @@ dependencies:
|
|||||||
injectable: ^2.3.2
|
injectable: ^2.3.2
|
||||||
riverpod_annotation: ^2.3.3
|
riverpod_annotation: ^2.3.3
|
||||||
cupertino_icons: ^1.0.6
|
cupertino_icons: ^1.0.6
|
||||||
fl_chart: ^0.69.0
|
fl_chart: ^0.70.1
|
||||||
marquee: ^2.2.3
|
marquee: ^2.2.3
|
||||||
# dynamic_layouts:
|
# dynamic_layouts:
|
||||||
# git:
|
# git:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user