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

26 lines
564 B
Dart

import 'package:flutter/foundation.dart';
import 'package:robo_advisory/models/user.dart';
class UserProvider with ChangeNotifier {
User _user = User.noUser;
int _selectedTabIndex = 0;
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();
}
}