feat : segmentation page

This commit is contained in:
2025-07-13 16:17:17 +03:30
parent d78a604d03
commit 2ae5f805af
16 changed files with 600 additions and 56 deletions

View File

@@ -6,7 +6,7 @@ part 'segmentation_model.g.dart';
@freezed
abstract class SegmentationModel with _$SegmentationModel {
const factory SegmentationModel({String? key, Buyer? buyer, DateTime? date, double? weight}) =
const factory SegmentationModel({String? key, Buyer? buyer, DateTime? date, int? weight}) =
_SegmentationModel;
factory SegmentationModel.fromJson(Map<String, dynamic> json) =>

View File

@@ -16,7 +16,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$SegmentationModel {
String? get key; Buyer? get buyer; DateTime? get date; double? get weight;
String? get key; Buyer? get buyer; DateTime? get date; int? get weight;
/// Create a copy of SegmentationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -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, double? weight
String? key, Buyer? buyer, DateTime? date, int? weight
});
@@ -72,7 +72,7 @@ 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 double?,
as int?,
));
}
/// Create a copy of SegmentationModel
@@ -101,7 +101,7 @@ class _SegmentationModel implements SegmentationModel {
@override final String? key;
@override final Buyer? buyer;
@override final DateTime? date;
@override final double? weight;
@override final int? weight;
/// Create a copy of SegmentationModel
/// with the given fields replaced by the non-null parameter values.
@@ -136,7 +136,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, double? weight
String? key, Buyer? buyer, DateTime? date, int? weight
});
@@ -159,7 +159,7 @@ 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 double?,
as int?,
));
}

View File

@@ -15,7 +15,7 @@ _SegmentationModel _$SegmentationModelFromJson(Map<String, dynamic> json) =>
date: json['date'] == null
? null
: DateTime.parse(json['date'] as String),
weight: (json['weight'] as num?)?.toDouble(),
weight: (json['weight'] as num?)?.toInt(),
);
Map<String, dynamic> _$SegmentationModelToJson(_SegmentationModel instance) =>