Line data Source code
1 : import 'package:freezed_annotation/freezed_annotation.dart'; 2 : 3 : part 'slice.freezed.dart'; 4 : part 'slice.g.dart'; 5 : 6 : ///Slice model 7 : /// 8 : ///Represents a slice and contains all of related info 9 : @freezed 10 : class Slice with _$Slice { 11 : ///Deafult factory constructor for Slice 12 : factory Slice({ 13 : @JsonKey(name: 'slice_label') String? sliceLabel, 14 : @JsonKey(name: 'slice_type') required String? sliceType, 15 : List<Map<String, dynamic>>? items, 16 : Map<String, dynamic>? primary, 17 : }) = _Slice; 18 : 19 : ///Creates a Slice object from json 20 2 : factory Slice.fromJson(Map<String, dynamic> json) => _$SliceFromJson(json); 21 : }