Your commit message here
This commit is contained in:
14
lib/providers/navigation_provider.dart
Normal file
14
lib/providers/navigation_provider.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
/// Provider to manage the bottom navigation index across the app
|
||||
final navigationProvider = StateNotifierProvider<NavigationNotifier, int>((ref) {
|
||||
return NavigationNotifier();
|
||||
});
|
||||
|
||||
class NavigationNotifier extends StateNotifier<int> {
|
||||
NavigationNotifier() : super(0);
|
||||
|
||||
void setIndex(int index) {
|
||||
state = index;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user