Fix category bug around "empty" category

This commit is contained in:
Ryan Pandya 2023-06-07 19:56:04 -04:00
parent 5eb90ac1e1
commit e18abcdcb8
2 changed files with 5 additions and 3 deletions

View File

@ -122,7 +122,6 @@ class CategoriesAPI extends ChangeNotifier {
Query.orderAsc("number"), Query.orderAsc("number"),
]); ]);
_categories = response.documents; _categories = response.documents;
_categories.removeWhere((element) => element.data['number'] == -1);
notifyListeners(); notifyListeners();
_ready = true; _ready = true;
} }

View File

@ -42,10 +42,13 @@ class _CategoriesPageState extends State<CategoriesPage> {
height: 0, height: 0,
thickness: 2, thickness: 2,
), ),
CategoryRow(category: category), category.number == -1
? SizedBox.shrink()
: CategoryRow(category: category),
], ],
); );
} }
return CategoryRow(category: category); return CategoryRow(category: category);
} }
return null; return null;
@ -79,7 +82,7 @@ class CategoryRow extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Container( Container(
constraints: BoxConstraints(maxHeight: 80, maxWidth: 70), constraints: BoxConstraints(maxHeight: 100, maxWidth: 70),
color: category.backgroundColor, color: category.backgroundColor,
child: SizedBox.expand( child: SizedBox.expand(
child: Center( child: Center(