mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-08 16:07:52 -06:00
20 lines
400 B
Dart
20 lines
400 B
Dart
import 'package:paperless_mobile/features/labels/model/label.model.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;
|
|
}
|
|
}
|