feat : segment page
This commit is contained in:
@@ -6,7 +6,7 @@ part 'segmentation_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class SegmentationModel with _$SegmentationModel {
|
||||
const factory SegmentationModel({String? key, Buyer? buyer, DateTime? date, int? weight}) =
|
||||
const factory SegmentationModel({String? key, Buyer? buyer, DateTime? date, int? weight,String? result}) =
|
||||
_SegmentationModel;
|
||||
|
||||
factory SegmentationModel.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -16,7 +16,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$SegmentationModel {
|
||||
|
||||
String? get key; Buyer? get buyer; DateTime? get date; int? get weight;
|
||||
String? get key; Buyer? get buyer; DateTime? get date; int? get weight; String? get result;
|
||||
/// Create a copy of SegmentationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -29,16 +29,16 @@ $SegmentationModelCopyWith<SegmentationModel> get copyWith => _$SegmentationMode
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SegmentationModel&&(identical(other.key, key) || other.key == key)&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.date, date) || other.date == date)&&(identical(other.weight, weight) || other.weight == weight));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SegmentationModel&&(identical(other.key, key) || other.key == key)&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.date, date) || other.date == date)&&(identical(other.weight, weight) || other.weight == weight)&&(identical(other.result, result) || other.result == result));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,buyer,date,weight);
|
||||
int get hashCode => Object.hash(runtimeType,key,buyer,date,weight,result);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SegmentationModel(key: $key, buyer: $buyer, date: $date, weight: $weight)';
|
||||
return 'SegmentationModel(key: $key, buyer: $buyer, date: $date, weight: $weight, result: $result)';
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ abstract mixin class $SegmentationModelCopyWith<$Res> {
|
||||
factory $SegmentationModelCopyWith(SegmentationModel value, $Res Function(SegmentationModel) _then) = _$SegmentationModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? key, Buyer? buyer, DateTime? date, int? weight
|
||||
String? key, Buyer? buyer, DateTime? date, int? weight, String? result
|
||||
});
|
||||
|
||||
|
||||
@@ -66,13 +66,14 @@ class _$SegmentationModelCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of SegmentationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? buyer = freezed,Object? date = freezed,Object? weight = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? buyer = freezed,Object? date = freezed,Object? weight = freezed,Object? result = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable
|
||||
as Buyer?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,weight: freezed == weight ? _self.weight : weight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
as int?,result: freezed == result ? _self.result : result // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of SegmentationModel
|
||||
@@ -95,13 +96,14 @@ $BuyerCopyWith<$Res>? get buyer {
|
||||
@JsonSerializable()
|
||||
|
||||
class _SegmentationModel implements SegmentationModel {
|
||||
const _SegmentationModel({this.key, this.buyer, this.date, this.weight});
|
||||
const _SegmentationModel({this.key, this.buyer, this.date, this.weight, this.result});
|
||||
factory _SegmentationModel.fromJson(Map<String, dynamic> json) => _$SegmentationModelFromJson(json);
|
||||
|
||||
@override final String? key;
|
||||
@override final Buyer? buyer;
|
||||
@override final DateTime? date;
|
||||
@override final int? weight;
|
||||
@override final String? result;
|
||||
|
||||
/// Create a copy of SegmentationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -116,16 +118,16 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SegmentationModel&&(identical(other.key, key) || other.key == key)&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.date, date) || other.date == date)&&(identical(other.weight, weight) || other.weight == weight));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SegmentationModel&&(identical(other.key, key) || other.key == key)&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.date, date) || other.date == date)&&(identical(other.weight, weight) || other.weight == weight)&&(identical(other.result, result) || other.result == result));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,buyer,date,weight);
|
||||
int get hashCode => Object.hash(runtimeType,key,buyer,date,weight,result);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SegmentationModel(key: $key, buyer: $buyer, date: $date, weight: $weight)';
|
||||
return 'SegmentationModel(key: $key, buyer: $buyer, date: $date, weight: $weight, result: $result)';
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +138,7 @@ abstract mixin class _$SegmentationModelCopyWith<$Res> implements $SegmentationM
|
||||
factory _$SegmentationModelCopyWith(_SegmentationModel value, $Res Function(_SegmentationModel) _then) = __$SegmentationModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? key, Buyer? buyer, DateTime? date, int? weight
|
||||
String? key, Buyer? buyer, DateTime? date, int? weight, String? result
|
||||
});
|
||||
|
||||
|
||||
@@ -153,13 +155,14 @@ class __$SegmentationModelCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of SegmentationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? buyer = freezed,Object? date = freezed,Object? weight = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? buyer = freezed,Object? date = freezed,Object? weight = freezed,Object? result = freezed,}) {
|
||||
return _then(_SegmentationModel(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable
|
||||
as Buyer?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,weight: freezed == weight ? _self.weight : weight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
as int?,result: freezed == result ? _self.result : result // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ _SegmentationModel _$SegmentationModelFromJson(Map<String, dynamic> json) =>
|
||||
? null
|
||||
: DateTime.parse(json['date'] as String),
|
||||
weight: (json['weight'] as num?)?.toInt(),
|
||||
result: json['result'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SegmentationModelToJson(_SegmentationModel instance) =>
|
||||
@@ -24,6 +25,7 @@ Map<String, dynamic> _$SegmentationModelToJson(_SegmentationModel instance) =>
|
||||
'buyer': instance.buyer,
|
||||
'date': instance.date?.toIso8601String(),
|
||||
'weight': instance.weight,
|
||||
'result': instance.result,
|
||||
};
|
||||
|
||||
_Buyer _$BuyerFromJson(Map<String, dynamic> json) => _Buyer(
|
||||
|
||||
Reference in New Issue
Block a user