Robo-advisory-dart/lib/providers/user_provider.dart

26 lines
564 B
Dart
Raw Permalink Normal View History

import 'package:flutter/foundation.dart';
import 'package:robo_advisory/models/user.dart';
class UserProvider with ChangeNotifier {
2022-09-11 14:37:28 +00:00
User _user = User.noUser;
int _selectedTabIndex = 0;
2022-09-11 16:10:44 +00:00
List<String> _categories = ["Workplace", "Equipment", "Home", "Other"];
List<String> get categories => _categories;
User get user => _user;
int get selectedTabIndex => _selectedTabIndex;
void setSelectedTabIndex(int index) {
_selectedTabIndex = index;
notifyListeners();
}
void setUser(User user) {
_user = user;
notifyListeners();
}
}