bottom bar higlight bug
This commit is contained in:
parent
260e502d64
commit
3bde2c96d4
@ -26,6 +26,8 @@ import 'package:uae_stat/presentation/components/indicators/locale_provider.dart
|
||||
import 'package:uae_stat/presentation/components/my_toggle.dart';
|
||||
import 'package:uae_stat/config/api_config.dart';
|
||||
|
||||
final selectedIndexProvider = StateProvider<int>((ref) => 0);
|
||||
|
||||
class BaseScaffold extends ConsumerStatefulWidget {
|
||||
const BaseScaffold({
|
||||
super.key,
|
||||
@ -1105,7 +1107,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
const EdgeInsets.only(bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.globe,
|
||||
color: _getSelectedIndex(currentRoute) == 2
|
||||
color: _getSelectedIndex(currentRoute) == 3
|
||||
? Colors.black
|
||||
: Color(0xFF989898),
|
||||
width: 20,
|
||||
@ -1148,11 +1150,12 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
case '/countryprofile':
|
||||
return 3;
|
||||
default:
|
||||
return 0;
|
||||
return ref.read(selectedIndexProvider);
|
||||
}
|
||||
}
|
||||
|
||||
void _onItemTapped(BuildContext context, int index) {
|
||||
ref.read(selectedIndexProvider.notifier).state = index;
|
||||
switch (index) {
|
||||
case 0:
|
||||
context.go('/myhomepage');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user