1
0
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:
Andrew Brogdon
2019-03-20 15:59:59 -07:00
committed by GitHub
parent a2419b3dcf
commit dcca6e44b2
7 changed files with 434 additions and 128 deletions

View File

@@ -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) {