mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Refactors detail view in advance of trivia (#60)
This commit is contained in:
@@ -70,7 +70,7 @@ class Preferences extends Model {
|
||||
_preferredCategories.clear();
|
||||
final names = prefs.getString(_preferredCategoriesKey);
|
||||
|
||||
if (names != null) {
|
||||
if (names != null && names.isNotEmpty) {
|
||||
for (final name in names.split(',')) {
|
||||
final index = int.tryParse(name) ?? -1;
|
||||
if (VeggieCategory.values[index] != null) {
|
||||
|
||||
Reference in New Issue
Block a user