Fix category bug around "empty" category
This commit is contained in:
parent
5eb90ac1e1
commit
e18abcdcb8
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user