mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-13 12:12:20 -06:00
Externalized API and models as own package
This commit is contained in:
19
lib/features/labels/bloc/label_state.dart
Normal file
19
lib/features/labels/bloc/label_state.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
|
||||
class LabelState<T extends Label> {
|
||||
LabelState.initial() : this(isLoaded: false, labels: {});
|
||||
final bool isLoaded;
|
||||
final Map<int, T> labels;
|
||||
|
||||
LabelState({
|
||||
required this.isLoaded,
|
||||
required this.labels,
|
||||
});
|
||||
|
||||
T? getLabel(int? key) {
|
||||
if (isLoaded) {
|
||||
return labels[key];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user