Skip to content

Commit

Permalink
Fix: sort categories
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Jul 16, 2023
1 parent 4a20368 commit e64dc16
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Consistent microphone icon across app
- Upgraded dependencies

### Fixed:
- Sort categories

## [0.8.392] - 2023-06-24
### Changed:
- Hide measurement suggestions when input dirty
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/habits/habit_category.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
Expand All @@ -22,7 +23,8 @@ class SelectCategoryWidget extends StatelessWidget {
return StreamBuilder<List<CategoryDefinition>>(
stream: getIt<JournalDb>().watchCategories(),
builder: (context, snapshot) {
final categories = snapshot.data ?? <CategoryDefinition>[];
final categories = snapshot.data ?? <CategoryDefinition>[]
..sortBy((category) => category.name);
final categoriesById = <String, CategoryDefinition>{};

for (final category in categories) {
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/settings/dashboards/dashboard_category.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:lotti/classes/entity_definitions.dart';
Expand Down Expand Up @@ -26,7 +27,8 @@ class SelectDashboardCategoryWidget extends StatelessWidget {
return StreamBuilder<List<CategoryDefinition>>(
stream: getIt<JournalDb>().watchCategories(),
builder: (context, snapshot) {
final categories = snapshot.data ?? <CategoryDefinition>[];
final categories = snapshot.data ?? <CategoryDefinition>[]
..sortBy((category) => category.name);
final categoriesById = <String, CategoryDefinition>{};

for (final category in categories) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: lotti
description: Achieve your goals and keep your data private with Lotti.
publish_to: 'none'
version: 0.9.394+2286
version: 0.9.394+2287

msix_config:
display_name: LottiApp
Expand Down

0 comments on commit e64dc16

Please sign in to comment.