chart screen app bar title bug
This commit is contained in:
parent
c623b1e1f7
commit
24179488a3
@ -427,10 +427,10 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
|||||||
// print(data_set);
|
// print(data_set);
|
||||||
final encodedMainTopic = Uri.encodeComponent(mainTopic);
|
final encodedMainTopic = Uri.encodeComponent(mainTopic);
|
||||||
final encodedTitle = Uri.encodeComponent(title);
|
final encodedTitle = Uri.encodeComponent(title);
|
||||||
|
final encodedKey = Uri.encodeQueryComponent('uaenumbers');
|
||||||
// Pass mainTopic and title as query parameters
|
// Pass mainTopic and title as query parameters
|
||||||
context.push(
|
context.push(
|
||||||
'/chartScreen/$data_set?bgColor=$colorPattern&mainTopic=$encodedMainTopic&title=$encodedTitle');
|
'/chartScreen/$data_set?bgColor=$colorPattern&mainTopic=$encodedMainTopic&title=$encodedTitle&key=$encodedKey');
|
||||||
// context.go('/chartScreen/$data_set');
|
// context.go('/chartScreen/$data_set');
|
||||||
},
|
},
|
||||||
child: Card(
|
child: Card(
|
||||||
|
|||||||
@ -2096,6 +2096,9 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final locale = ref.watch(localeProvider);
|
final locale = ref.watch(localeProvider);
|
||||||
final localeNotifier = ref.read(localeProvider.notifier);
|
final localeNotifier = ref.read(localeProvider.notifier);
|
||||||
|
String url=GoRouterState.of(context).uri.toString();
|
||||||
|
final uri = Uri.parse(url);
|
||||||
|
final pageTitle = uri.queryParameters['key'] ?? '';
|
||||||
|
|
||||||
final isConnected = ref.watch(connectivityProvider);
|
final isConnected = ref.watch(connectivityProvider);
|
||||||
|
|
||||||
@ -2184,7 +2187,9 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
|
|||||||
|
|
||||||
child: BaseScaffold(
|
child: BaseScaffold(
|
||||||
key: _scaffoldKey,
|
key: _scaffoldKey,
|
||||||
title: Text(
|
title: (pageTitle == 'home')
|
||||||
|
? Text(AppLocalizations.of(context)!.nav_home)
|
||||||
|
: Text(
|
||||||
context.translate(
|
context.translate(
|
||||||
'UAE Numbers',
|
'UAE Numbers',
|
||||||
'أرقام الإمارات',
|
'أرقام الإمارات',
|
||||||
|
|||||||
@ -95,6 +95,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
|||||||
locale = ref.read(localeProvider) ?? const Locale('en');
|
locale = ref.read(localeProvider) ?? const Locale('en');
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
_startAppbarTour();
|
_startAppbarTour();
|
||||||
|
_routeToIndex();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,6 +698,17 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
|||||||
// }
|
// }
|
||||||
final PAuthRepo _authRepo = PAuthRepo();
|
final PAuthRepo _authRepo = PAuthRepo();
|
||||||
|
|
||||||
|
void _routeToIndex() {
|
||||||
|
String url=GoRouterState.of(context).uri.toString();
|
||||||
|
final uri = Uri.parse(url);
|
||||||
|
final fromValue = uri.queryParameters['key'] ?? '';
|
||||||
|
if (fromValue=='home'){
|
||||||
|
ref.read(selectedIndexProvider.notifier).state= 0;
|
||||||
|
}else if (fromValue=='uaenumbers'){
|
||||||
|
ref.read(selectedIndexProvider.notifier).state= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> logout(BuildContext context) async {
|
Future<void> logout(BuildContext context) async {
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
await _authRepo.logout();
|
await _authRepo.logout();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user