upgrade-to-flutter-3 #1

Merged
motia merged 9 commits from upgrade-to-flutter-2 into master 2022-09-11 16:22:21 +00:00
2 changed files with 16 additions and 11 deletions
Showing only changes of commit 3baa33a838 - Show all commits

View file

@ -5,7 +5,7 @@ class UserProvider with ChangeNotifier {
User _user = User.noUser;
int _selectedTabIndex = 0;
List<String> _categories = ["All", "Workplace", "Equipment", "Home", "Other"];
List<String> _categories = ["Workplace", "Equipment", "Home", "Other"];
List<String> get categories => _categories;

View file

@ -57,19 +57,24 @@ class _HistoryScreenState extends State<HistoryScreen> {
children: [
DropdownButton<String>(
isExpanded: true,
items: Provider.of<UserProvider>(context, listen: true)
items: [
DropdownMenuItem<String>(
value: null,
child: Text('All'),
),
...Provider.of<UserProvider>(context, listen: true)
.categories
.map((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
})
],
hint: new Text("Select Category"),
value: Provider.of<TransactionProvider>(context,
listen: true)
.selectedCategory ??
'All',
.selectedCategory,
onChanged: (String? newValue) {
Provider.of<TransactionProvider>(context,
listen: false)