Line data Source code
1 : import 'package:fast_immutable_collections/fast_immutable_collections.dart';
2 : import 'package:freezed_annotation/freezed_annotation.dart';
3 : import 'package:redfire/types.dart';
4 :
5 : import 'section_model.dart';
6 :
7 : part 'sections_v_m.freezed.dart';
8 : part 'sections_v_m.g.dart';
9 :
10 : @freezed
11 : class SectionsVM with _$SectionsVM {
12 6 : const SectionsVM._();
13 : const factory SectionsVM({
14 : required String newName,
15 : required IList<SectionModel> list,
16 : required bool creatingNewSection,
17 : }) = _SectionsVM;
18 :
19 0 : factory SectionsVM.fromJson(JsonMap json) => _$SectionsVMFromJson(json);
20 :
21 12 : factory SectionsVM.init() => SectionsVM(
22 12 : list: <SectionModel>[].lock, newName: '', creatingNewSection: false);
23 : }
|