mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-10 19:07:02 +01:00
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
18 lines
671 B
Dart
18 lines
671 B
Dart
import 'package:todo/data/note.dart';
|
|
import 'package:todo/data/note_repository.dart';
|
|
|
|
/// The default status selection: hide completed/dropped work.
|
|
const Set<Status> kDefaultStatuses = {Status.todo, Status.inProgress};
|
|
|
|
/// The notes list's unfiltered baseline, which "Clear all" resets to.
|
|
const kDefaultNoteFilter = NoteFilter(statuses: kDefaultStatuses);
|
|
|
|
/// Facets the user changed from [kDefaultNoteFilter], for the filter badge.
|
|
int userFacetCount(NoteFilter filter) {
|
|
var count = filter.activeCount;
|
|
if (_same(filter.statuses, kDefaultStatuses)) count -= 1;
|
|
return count;
|
|
}
|
|
|
|
bool _same<T>(Set<T> a, Set<T> b) => a.length == b.length && a.containsAll(b);
|