Broke GeneratedFormItem into sub-types

Prep for "chips" input type
This commit is contained in:
Imran Remtulla
2022-12-21 18:23:25 -05:00
parent 3cbaac2f5d
commit 9072862862
21 changed files with 238 additions and 188 deletions

View File

@@ -155,12 +155,12 @@ class SettingsProvider with ChangeNotifier {
prefs?.setString('categories', jsonEncode(cats));
}
getCategoryFormItem({String initCategory = ''}) =>
GeneratedFormItem('category',
label: tr('category'),
opts: [
MapEntry('', tr('noCategory')),
...categories.entries.map((e) => MapEntry(e.key, e.key)).toList()
],
defaultValue: initCategory);
getCategoryFormItem({String initCategory = ''}) => GeneratedFormDropdown(
'category',
label: tr('category'),
[
MapEntry('', tr('noCategory')),
...categories.entries.map((e) => MapEntry(e.key, e.key)).toList()
],
defaultValue: initCategory);
}