custome drawer changes

This commit is contained in:
venbaittech 2025-01-16 18:28:13 +05:30
parent 6725924831
commit dceda7c568
2 changed files with 50 additions and 98 deletions

View File

@ -1033,51 +1033,51 @@
// }); // });
// } // }
// //
[ // [
{ // {
chart_heading :"Guest Nights by Region" // chart_heading :"Guest Nights by Region"
chart_type :"fl_stacked_bar" // chart_type :"fl_stacked_bar"
dataset :"hotels" // dataset :"hotels"
group_by :"GUEST_REGION" // group_by :"GUEST_REGION"
is_chart :"true" // is_chart :"true"
kpi :"hotel_occupancy_rate_chart_1" // kpi :"hotel_occupancy_rate_chart_1"
main_id :"economy" // main_id :"economy"
response:[ // response:[
{ // {
"ObsKey": { // "ObsKey": {
"FREQ": "A", // "FREQ": "A",
"GUEST_REGION": "AF", // "GUEST_REGION": "AF",
"H_INDICATOR": "GUN", // "H_INDICATOR": "GUN",
"H_TYPE": "_Z", // "H_TYPE": "_Z",
"MEASURE": "H", // "MEASURE": "H",
"REF_AREA": "AE", // "REF_AREA": "AE",
"SOURCE_DETAIL": "FCSC", // "SOURCE_DETAIL": "FCSC",
"TIME_PERIOD": "2016", // "TIME_PERIOD": "2016",
"UNIT_MEASURE": "NUMBER" // "UNIT_MEASURE": "NUMBER"
}, // },
"ObsValue": { // "ObsValue": {
"Value": "2659446" // "Value": "2659446"
} // }
}, // },
{ // {
"ObsKey": { // "ObsKey": {
"FREQ": "A", // "FREQ": "A",
"GUEST_REGION": "OC", // "GUEST_REGION": "OC",
"H_INDICATOR": "GUN", // "H_INDICATOR": "GUN",
"H_TYPE": "_Z", // "H_TYPE": "_Z",
"MEASURE": "H", // "MEASURE": "H",
"REF_AREA": "AE", // "REF_AREA": "AE",
"SOURCE_DETAIL": "FCSC", // "SOURCE_DETAIL": "FCSC",
"TIME_PERIOD": "2018", // "TIME_PERIOD": "2018",
"UNIT_MEASURE": "NUMBER" // "UNIT_MEASURE": "NUMBER"
}, // },
"ObsValue": { // "ObsValue": {
"Value": "1127282" // "Value": "1127282"
} // }
} // }
//
] // ]
sub_id :"tourism" // sub_id :"tourism"
url :"https://releaseeuaestat.fcsc.gov.ae/rest/data/FCSA,DF_GUEST_REGION,4.3.0/...A..GUN.OTH+OC+AF+EC+AM+AC+ASC+GCC+UAE.?startPeriod=2016&dimensionAtObservation=AllDimensions" // url :"https://releaseeuaestat.fcsc.gov.ae/rest/data/FCSA,DF_GUEST_REGION,4.3.0/...A..GUN.OTH+OC+AF+EC+AM+AC+ASC+GCC+UAE.?startPeriod=2016&dimensionAtObservation=AllDimensions"
} // }
] // ]

View File

@ -1,13 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:uae_stat/presentation/components/my_toggle.dart';
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:pocketbase/pocketbase.dart'; import 'package:pocketbase/pocketbase.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
class BaseScaffold extends ConsumerWidget { class BaseScaffold extends StatefulWidget {
final Widget body; final Widget body;
final Widget title; final Widget title;
final bool? showBackButton; final bool? showBackButton;
@ -102,54 +98,10 @@ class _BaseScaffoldState extends State<BaseScaffold> {
} }
@override @override
Widget build(BuildContext context ,WidgetRef ref) { Widget build(BuildContext context) {
final locale = ref.watch(localeProvider);
final localeNotifier = ref.read(localeProvider.notifier);
// Get the current route to highlight the active item
String currentRoute = GoRouterState.of(context).matchedLocation; String currentRoute = GoRouterState.of(context).matchedLocation;
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(
appBar: AppBar(title: title, backgroundColor : appbarColor,actions: [
// IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)),
MyToggle(isOn: locale?.languageCode == 'en',
knobTextWhenOn: 'ع',
knobTextWhenOff: 'EN',
pathColorWhenOn: Colors.grey.shade300,
pathColorWhenOff: Colors.grey.shade300,
onTap: (){
ref.read(localeProvider.notifier).toggleLocale();
},),
],
leading:
// Stack(
// children: [
// // Show the back button if showBackButton is true, otherwise show the drawer menu
// if (showBackButton == true)
// Positioned(
// left: 0,
// 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: 0,
// child: IconButton(
// color: (showBackButton == true)? Colors.white : Colors.black,
// icon: Icon(Icons.menu),
// onPressed: () {
// // Open the drawer using the Scaffold context
// Scaffold.of(context).openDrawer();
// },
// ),
// ),
// ],
// ),
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(