Skip to content

Commit

Permalink
isEmpty instead of ==0
Browse files Browse the repository at this point in the history
  • Loading branch information
Miroslav Mazel committed Nov 5, 2023
1 parent f31bcc7 commit 9a34eac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/widgets/gallery/overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Gallery extends StatelessWidget {
padding: const EdgeInsets.all(5),
child: RefreshIndicator(
onRefresh: () => provider.fetchAndSetGallery(),
child: provider.images.length == 0
child: provider.images.isEmpty
? TextPrompt()
: MasonryGridView.count(
crossAxisCount: 2,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/nutrition/nutritional_plans_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class NutritionalPlansList extends StatelessWidget {
Widget build(BuildContext context) {
return RefreshIndicator(
onRefresh: () => _nutritionProvider.fetchAndSetAllPlansSparse(),
child: _nutritionProvider.items.length == 0
child: _nutritionProvider.items.isEmpty
? TextPrompt()
: ListView.builder(
padding: const EdgeInsets.all(10.0),
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/workouts/workout_plans_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class WorkoutPlansList extends StatelessWidget {
Widget build(BuildContext context) {
return RefreshIndicator(
onRefresh: () => _workoutProvider.fetchAndSetAllPlansSparse(),
child: _workoutProvider.items.length == 0
child: _workoutProvider.items.isEmpty
? TextPrompt()
: ListView.builder(
padding: const EdgeInsets.all(10.0),
Expand Down

0 comments on commit 9a34eac

Please sign in to comment.