feat : profile and map

This commit is contained in:
2025-07-28 15:57:30 +03:30
parent 6057976b46
commit d9724f681c
67 changed files with 2835 additions and 444 deletions

View File

@@ -0,0 +1,68 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'poultry_location_model.freezed.dart';
part 'poultry_location_model.g.dart';
@freezed
abstract class PoultryLocationModel with _$PoultryLocationModel {
const factory PoultryLocationModel({
int? id,
String? unitName,
@JsonKey(name: 'Lat')
double? lat,
@JsonKey(name: 'Long')
double? long,
User? user,
List<Hatching>? hatching,
Address? address,
}) = _PoultryLocationModel;
factory PoultryLocationModel.fromJson(Map<String, dynamic> json) =>
_$PoultryLocationModelFromJson(json);
}
@freezed
abstract class User with _$User {
const factory User({
String? fullname,
String? mobile,
}) = _User;
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
}
@freezed
abstract class Hatching with _$Hatching {
const factory Hatching({
int? quantity,
int? leftOver,
int? period,
int? chickenAge,
DateTime? date,
bool?violation,
bool?archive,
}) = _Hatching;
factory Hatching.fromJson(Map<String, dynamic> json) =>
_$HatchingFromJson(json);
}
@freezed
abstract class Address with _$Address {
const factory Address({
City? city,
String? address,
}) = _Address;
factory Address.fromJson(Map<String, dynamic> json) =>
_$AddressFromJson(json);
}
@freezed
abstract class City with _$City {
const factory City({
String? name,
}) = _City;
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
}