feat : request tagging

This commit is contained in:
2025-08-05 14:49:01 +03:30
parent 59e6d621cf
commit f571a5b646
4 changed files with 1707 additions and 135 deletions

View File

@@ -0,0 +1,650 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'address.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$Address {
String? get road; String? get neighbourhood; String? get suburb; String? get state; String? get borough; String? get city; String? get district; String? get county; String? get province; String? get ISO3166_2_lvl4; String? get postcode; String? get country; String? get country_code;
/// Create a copy of Address
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AddressCopyWith<Address> get copyWith => _$AddressCopyWithImpl<Address>(this as Address, _$identity);
/// Serializes this Address to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is Address&&(identical(other.road, road) || other.road == road)&&(identical(other.neighbourhood, neighbourhood) || other.neighbourhood == neighbourhood)&&(identical(other.suburb, suburb) || other.suburb == suburb)&&(identical(other.state, state) || other.state == state)&&(identical(other.borough, borough) || other.borough == borough)&&(identical(other.city, city) || other.city == city)&&(identical(other.district, district) || other.district == district)&&(identical(other.county, county) || other.county == county)&&(identical(other.province, province) || other.province == province)&&(identical(other.ISO3166_2_lvl4, ISO3166_2_lvl4) || other.ISO3166_2_lvl4 == ISO3166_2_lvl4)&&(identical(other.postcode, postcode) || other.postcode == postcode)&&(identical(other.country, country) || other.country == country)&&(identical(other.country_code, country_code) || other.country_code == country_code));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,road,neighbourhood,suburb,state,borough,city,district,county,province,ISO3166_2_lvl4,postcode,country,country_code);
@override
String toString() {
return 'Address(road: $road, neighbourhood: $neighbourhood, suburb: $suburb, state: $state, borough: $borough, city: $city, district: $district, county: $county, province: $province, ISO3166_2_lvl4: $ISO3166_2_lvl4, postcode: $postcode, country: $country, country_code: $country_code)';
}
}
/// @nodoc
abstract mixin class $AddressCopyWith<$Res> {
factory $AddressCopyWith(Address value, $Res Function(Address) _then) = _$AddressCopyWithImpl;
@useResult
$Res call({
String? road, String? neighbourhood, String? suburb, String? state, String? borough, String? city, String? district, String? county, String? province, String? ISO3166_2_lvl4, String? postcode, String? country, String? country_code
});
}
/// @nodoc
class _$AddressCopyWithImpl<$Res>
implements $AddressCopyWith<$Res> {
_$AddressCopyWithImpl(this._self, this._then);
final Address _self;
final $Res Function(Address) _then;
/// Create a copy of Address
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? road = freezed,Object? neighbourhood = freezed,Object? suburb = freezed,Object? state = freezed,Object? borough = freezed,Object? city = freezed,Object? district = freezed,Object? county = freezed,Object? province = freezed,Object? ISO3166_2_lvl4 = freezed,Object? postcode = freezed,Object? country = freezed,Object? country_code = freezed,}) {
return _then(_self.copyWith(
road: freezed == road ? _self.road : road // ignore: cast_nullable_to_non_nullable
as String?,neighbourhood: freezed == neighbourhood ? _self.neighbourhood : neighbourhood // ignore: cast_nullable_to_non_nullable
as String?,suburb: freezed == suburb ? _self.suburb : suburb // ignore: cast_nullable_to_non_nullable
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,borough: freezed == borough ? _self.borough : borough // ignore: cast_nullable_to_non_nullable
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,district: freezed == district ? _self.district : district // ignore: cast_nullable_to_non_nullable
as String?,county: freezed == county ? _self.county : county // ignore: cast_nullable_to_non_nullable
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String?,ISO3166_2_lvl4: freezed == ISO3166_2_lvl4 ? _self.ISO3166_2_lvl4 : ISO3166_2_lvl4 // ignore: cast_nullable_to_non_nullable
as String?,postcode: freezed == postcode ? _self.postcode : postcode // ignore: cast_nullable_to_non_nullable
as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
as String?,country_code: freezed == country_code ? _self.country_code : country_code // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [Address].
extension AddressPatterns on Address {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _Address value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _Address() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _Address value) $default,){
final _that = this;
switch (_that) {
case _Address():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _Address value)? $default,){
final _that = this;
switch (_that) {
case _Address() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? road, String? neighbourhood, String? suburb, String? state, String? borough, String? city, String? district, String? county, String? province, String? ISO3166_2_lvl4, String? postcode, String? country, String? country_code)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Address() when $default != null:
return $default(_that.road,_that.neighbourhood,_that.suburb,_that.state,_that.borough,_that.city,_that.district,_that.county,_that.province,_that.ISO3166_2_lvl4,_that.postcode,_that.country,_that.country_code);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? road, String? neighbourhood, String? suburb, String? state, String? borough, String? city, String? district, String? county, String? province, String? ISO3166_2_lvl4, String? postcode, String? country, String? country_code) $default,) {final _that = this;
switch (_that) {
case _Address():
return $default(_that.road,_that.neighbourhood,_that.suburb,_that.state,_that.borough,_that.city,_that.district,_that.county,_that.province,_that.ISO3166_2_lvl4,_that.postcode,_that.country,_that.country_code);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? road, String? neighbourhood, String? suburb, String? state, String? borough, String? city, String? district, String? county, String? province, String? ISO3166_2_lvl4, String? postcode, String? country, String? country_code)? $default,) {final _that = this;
switch (_that) {
case _Address() when $default != null:
return $default(_that.road,_that.neighbourhood,_that.suburb,_that.state,_that.borough,_that.city,_that.district,_that.county,_that.province,_that.ISO3166_2_lvl4,_that.postcode,_that.country,_that.country_code);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _Address implements Address {
const _Address({this.road, this.neighbourhood, this.suburb, this.state, this.borough, this.city, this.district, this.county, this.province, this.ISO3166_2_lvl4, this.postcode, this.country, this.country_code});
factory _Address.fromJson(Map<String, dynamic> json) => _$AddressFromJson(json);
@override final String? road;
@override final String? neighbourhood;
@override final String? suburb;
@override final String? state;
@override final String? borough;
@override final String? city;
@override final String? district;
@override final String? county;
@override final String? province;
@override final String? ISO3166_2_lvl4;
@override final String? postcode;
@override final String? country;
@override final String? country_code;
/// Create a copy of Address
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AddressCopyWith<_Address> get copyWith => __$AddressCopyWithImpl<_Address>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$AddressToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Address&&(identical(other.road, road) || other.road == road)&&(identical(other.neighbourhood, neighbourhood) || other.neighbourhood == neighbourhood)&&(identical(other.suburb, suburb) || other.suburb == suburb)&&(identical(other.state, state) || other.state == state)&&(identical(other.borough, borough) || other.borough == borough)&&(identical(other.city, city) || other.city == city)&&(identical(other.district, district) || other.district == district)&&(identical(other.county, county) || other.county == county)&&(identical(other.province, province) || other.province == province)&&(identical(other.ISO3166_2_lvl4, ISO3166_2_lvl4) || other.ISO3166_2_lvl4 == ISO3166_2_lvl4)&&(identical(other.postcode, postcode) || other.postcode == postcode)&&(identical(other.country, country) || other.country == country)&&(identical(other.country_code, country_code) || other.country_code == country_code));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,road,neighbourhood,suburb,state,borough,city,district,county,province,ISO3166_2_lvl4,postcode,country,country_code);
@override
String toString() {
return 'Address(road: $road, neighbourhood: $neighbourhood, suburb: $suburb, state: $state, borough: $borough, city: $city, district: $district, county: $county, province: $province, ISO3166_2_lvl4: $ISO3166_2_lvl4, postcode: $postcode, country: $country, country_code: $country_code)';
}
}
/// @nodoc
abstract mixin class _$AddressCopyWith<$Res> implements $AddressCopyWith<$Res> {
factory _$AddressCopyWith(_Address value, $Res Function(_Address) _then) = __$AddressCopyWithImpl;
@override @useResult
$Res call({
String? road, String? neighbourhood, String? suburb, String? state, String? borough, String? city, String? district, String? county, String? province, String? ISO3166_2_lvl4, String? postcode, String? country, String? country_code
});
}
/// @nodoc
class __$AddressCopyWithImpl<$Res>
implements _$AddressCopyWith<$Res> {
__$AddressCopyWithImpl(this._self, this._then);
final _Address _self;
final $Res Function(_Address) _then;
/// Create a copy of Address
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? road = freezed,Object? neighbourhood = freezed,Object? suburb = freezed,Object? state = freezed,Object? borough = freezed,Object? city = freezed,Object? district = freezed,Object? county = freezed,Object? province = freezed,Object? ISO3166_2_lvl4 = freezed,Object? postcode = freezed,Object? country = freezed,Object? country_code = freezed,}) {
return _then(_Address(
road: freezed == road ? _self.road : road // ignore: cast_nullable_to_non_nullable
as String?,neighbourhood: freezed == neighbourhood ? _self.neighbourhood : neighbourhood // ignore: cast_nullable_to_non_nullable
as String?,suburb: freezed == suburb ? _self.suburb : suburb // ignore: cast_nullable_to_non_nullable
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,borough: freezed == borough ? _self.borough : borough // ignore: cast_nullable_to_non_nullable
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,district: freezed == district ? _self.district : district // ignore: cast_nullable_to_non_nullable
as String?,county: freezed == county ? _self.county : county // ignore: cast_nullable_to_non_nullable
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String?,ISO3166_2_lvl4: freezed == ISO3166_2_lvl4 ? _self.ISO3166_2_lvl4 : ISO3166_2_lvl4 // ignore: cast_nullable_to_non_nullable
as String?,postcode: freezed == postcode ? _self.postcode : postcode // ignore: cast_nullable_to_non_nullable
as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
as String?,country_code: freezed == country_code ? _self.country_code : country_code // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
mixin _$LocationDetails {
int? get place_id; String? get licence; String? get osm_type; int? get osm_id; String? get lat; String? get lon; String? get class_; String? get type; int? get place_rank; double? get importance; String? get addresstype; String? get name; String? get display_name; Address? get address; List<String>? get boundingbox;
/// Create a copy of LocationDetails
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$LocationDetailsCopyWith<LocationDetails> get copyWith => _$LocationDetailsCopyWithImpl<LocationDetails>(this as LocationDetails, _$identity);
/// Serializes this LocationDetails to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LocationDetails&&(identical(other.place_id, place_id) || other.place_id == place_id)&&(identical(other.licence, licence) || other.licence == licence)&&(identical(other.osm_type, osm_type) || other.osm_type == osm_type)&&(identical(other.osm_id, osm_id) || other.osm_id == osm_id)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.lon, lon) || other.lon == lon)&&(identical(other.class_, class_) || other.class_ == class_)&&(identical(other.type, type) || other.type == type)&&(identical(other.place_rank, place_rank) || other.place_rank == place_rank)&&(identical(other.importance, importance) || other.importance == importance)&&(identical(other.addresstype, addresstype) || other.addresstype == addresstype)&&(identical(other.name, name) || other.name == name)&&(identical(other.display_name, display_name) || other.display_name == display_name)&&(identical(other.address, address) || other.address == address)&&const DeepCollectionEquality().equals(other.boundingbox, boundingbox));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,place_id,licence,osm_type,osm_id,lat,lon,class_,type,place_rank,importance,addresstype,name,display_name,address,const DeepCollectionEquality().hash(boundingbox));
@override
String toString() {
return 'LocationDetails(place_id: $place_id, licence: $licence, osm_type: $osm_type, osm_id: $osm_id, lat: $lat, lon: $lon, class_: $class_, type: $type, place_rank: $place_rank, importance: $importance, addresstype: $addresstype, name: $name, display_name: $display_name, address: $address, boundingbox: $boundingbox)';
}
}
/// @nodoc
abstract mixin class $LocationDetailsCopyWith<$Res> {
factory $LocationDetailsCopyWith(LocationDetails value, $Res Function(LocationDetails) _then) = _$LocationDetailsCopyWithImpl;
@useResult
$Res call({
int? place_id, String? licence, String? osm_type, int? osm_id, String? lat, String? lon, String? class_, String? type, int? place_rank, double? importance, String? addresstype, String? name, String? display_name, Address? address, List<String>? boundingbox
});
$AddressCopyWith<$Res>? get address;
}
/// @nodoc
class _$LocationDetailsCopyWithImpl<$Res>
implements $LocationDetailsCopyWith<$Res> {
_$LocationDetailsCopyWithImpl(this._self, this._then);
final LocationDetails _self;
final $Res Function(LocationDetails) _then;
/// Create a copy of LocationDetails
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? place_id = freezed,Object? licence = freezed,Object? osm_type = freezed,Object? osm_id = freezed,Object? lat = freezed,Object? lon = freezed,Object? class_ = freezed,Object? type = freezed,Object? place_rank = freezed,Object? importance = freezed,Object? addresstype = freezed,Object? name = freezed,Object? display_name = freezed,Object? address = freezed,Object? boundingbox = freezed,}) {
return _then(_self.copyWith(
place_id: freezed == place_id ? _self.place_id : place_id // ignore: cast_nullable_to_non_nullable
as int?,licence: freezed == licence ? _self.licence : licence // ignore: cast_nullable_to_non_nullable
as String?,osm_type: freezed == osm_type ? _self.osm_type : osm_type // ignore: cast_nullable_to_non_nullable
as String?,osm_id: freezed == osm_id ? _self.osm_id : osm_id // ignore: cast_nullable_to_non_nullable
as int?,lat: freezed == lat ? _self.lat : lat // ignore: cast_nullable_to_non_nullable
as String?,lon: freezed == lon ? _self.lon : lon // ignore: cast_nullable_to_non_nullable
as String?,class_: freezed == class_ ? _self.class_ : class_ // ignore: cast_nullable_to_non_nullable
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String?,place_rank: freezed == place_rank ? _self.place_rank : place_rank // ignore: cast_nullable_to_non_nullable
as int?,importance: freezed == importance ? _self.importance : importance // ignore: cast_nullable_to_non_nullable
as double?,addresstype: freezed == addresstype ? _self.addresstype : addresstype // ignore: cast_nullable_to_non_nullable
as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,display_name: freezed == display_name ? _self.display_name : display_name // ignore: cast_nullable_to_non_nullable
as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as Address?,boundingbox: freezed == boundingbox ? _self.boundingbox : boundingbox // ignore: cast_nullable_to_non_nullable
as List<String>?,
));
}
/// Create a copy of LocationDetails
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AddressCopyWith<$Res>? get address {
if (_self.address == null) {
return null;
}
return $AddressCopyWith<$Res>(_self.address!, (value) {
return _then(_self.copyWith(address: value));
});
}
}
/// Adds pattern-matching-related methods to [LocationDetails].
extension LocationDetailsPatterns on LocationDetails {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LocationDetails value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _LocationDetails() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LocationDetails value) $default,){
final _that = this;
switch (_that) {
case _LocationDetails():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LocationDetails value)? $default,){
final _that = this;
switch (_that) {
case _LocationDetails() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? place_id, String? licence, String? osm_type, int? osm_id, String? lat, String? lon, String? class_, String? type, int? place_rank, double? importance, String? addresstype, String? name, String? display_name, Address? address, List<String>? boundingbox)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LocationDetails() when $default != null:
return $default(_that.place_id,_that.licence,_that.osm_type,_that.osm_id,_that.lat,_that.lon,_that.class_,_that.type,_that.place_rank,_that.importance,_that.addresstype,_that.name,_that.display_name,_that.address,_that.boundingbox);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? place_id, String? licence, String? osm_type, int? osm_id, String? lat, String? lon, String? class_, String? type, int? place_rank, double? importance, String? addresstype, String? name, String? display_name, Address? address, List<String>? boundingbox) $default,) {final _that = this;
switch (_that) {
case _LocationDetails():
return $default(_that.place_id,_that.licence,_that.osm_type,_that.osm_id,_that.lat,_that.lon,_that.class_,_that.type,_that.place_rank,_that.importance,_that.addresstype,_that.name,_that.display_name,_that.address,_that.boundingbox);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? place_id, String? licence, String? osm_type, int? osm_id, String? lat, String? lon, String? class_, String? type, int? place_rank, double? importance, String? addresstype, String? name, String? display_name, Address? address, List<String>? boundingbox)? $default,) {final _that = this;
switch (_that) {
case _LocationDetails() when $default != null:
return $default(_that.place_id,_that.licence,_that.osm_type,_that.osm_id,_that.lat,_that.lon,_that.class_,_that.type,_that.place_rank,_that.importance,_that.addresstype,_that.name,_that.display_name,_that.address,_that.boundingbox);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _LocationDetails implements LocationDetails {
const _LocationDetails({this.place_id, this.licence, this.osm_type, this.osm_id, this.lat, this.lon, this.class_, this.type, this.place_rank, this.importance, this.addresstype, this.name, this.display_name, this.address, final List<String>? boundingbox}): _boundingbox = boundingbox;
factory _LocationDetails.fromJson(Map<String, dynamic> json) => _$LocationDetailsFromJson(json);
@override final int? place_id;
@override final String? licence;
@override final String? osm_type;
@override final int? osm_id;
@override final String? lat;
@override final String? lon;
@override final String? class_;
@override final String? type;
@override final int? place_rank;
@override final double? importance;
@override final String? addresstype;
@override final String? name;
@override final String? display_name;
@override final Address? address;
final List<String>? _boundingbox;
@override List<String>? get boundingbox {
final value = _boundingbox;
if (value == null) return null;
if (_boundingbox is EqualUnmodifiableListView) return _boundingbox;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
/// Create a copy of LocationDetails
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$LocationDetailsCopyWith<_LocationDetails> get copyWith => __$LocationDetailsCopyWithImpl<_LocationDetails>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$LocationDetailsToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LocationDetails&&(identical(other.place_id, place_id) || other.place_id == place_id)&&(identical(other.licence, licence) || other.licence == licence)&&(identical(other.osm_type, osm_type) || other.osm_type == osm_type)&&(identical(other.osm_id, osm_id) || other.osm_id == osm_id)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.lon, lon) || other.lon == lon)&&(identical(other.class_, class_) || other.class_ == class_)&&(identical(other.type, type) || other.type == type)&&(identical(other.place_rank, place_rank) || other.place_rank == place_rank)&&(identical(other.importance, importance) || other.importance == importance)&&(identical(other.addresstype, addresstype) || other.addresstype == addresstype)&&(identical(other.name, name) || other.name == name)&&(identical(other.display_name, display_name) || other.display_name == display_name)&&(identical(other.address, address) || other.address == address)&&const DeepCollectionEquality().equals(other._boundingbox, _boundingbox));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,place_id,licence,osm_type,osm_id,lat,lon,class_,type,place_rank,importance,addresstype,name,display_name,address,const DeepCollectionEquality().hash(_boundingbox));
@override
String toString() {
return 'LocationDetails(place_id: $place_id, licence: $licence, osm_type: $osm_type, osm_id: $osm_id, lat: $lat, lon: $lon, class_: $class_, type: $type, place_rank: $place_rank, importance: $importance, addresstype: $addresstype, name: $name, display_name: $display_name, address: $address, boundingbox: $boundingbox)';
}
}
/// @nodoc
abstract mixin class _$LocationDetailsCopyWith<$Res> implements $LocationDetailsCopyWith<$Res> {
factory _$LocationDetailsCopyWith(_LocationDetails value, $Res Function(_LocationDetails) _then) = __$LocationDetailsCopyWithImpl;
@override @useResult
$Res call({
int? place_id, String? licence, String? osm_type, int? osm_id, String? lat, String? lon, String? class_, String? type, int? place_rank, double? importance, String? addresstype, String? name, String? display_name, Address? address, List<String>? boundingbox
});
@override $AddressCopyWith<$Res>? get address;
}
/// @nodoc
class __$LocationDetailsCopyWithImpl<$Res>
implements _$LocationDetailsCopyWith<$Res> {
__$LocationDetailsCopyWithImpl(this._self, this._then);
final _LocationDetails _self;
final $Res Function(_LocationDetails) _then;
/// Create a copy of LocationDetails
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? place_id = freezed,Object? licence = freezed,Object? osm_type = freezed,Object? osm_id = freezed,Object? lat = freezed,Object? lon = freezed,Object? class_ = freezed,Object? type = freezed,Object? place_rank = freezed,Object? importance = freezed,Object? addresstype = freezed,Object? name = freezed,Object? display_name = freezed,Object? address = freezed,Object? boundingbox = freezed,}) {
return _then(_LocationDetails(
place_id: freezed == place_id ? _self.place_id : place_id // ignore: cast_nullable_to_non_nullable
as int?,licence: freezed == licence ? _self.licence : licence // ignore: cast_nullable_to_non_nullable
as String?,osm_type: freezed == osm_type ? _self.osm_type : osm_type // ignore: cast_nullable_to_non_nullable
as String?,osm_id: freezed == osm_id ? _self.osm_id : osm_id // ignore: cast_nullable_to_non_nullable
as int?,lat: freezed == lat ? _self.lat : lat // ignore: cast_nullable_to_non_nullable
as String?,lon: freezed == lon ? _self.lon : lon // ignore: cast_nullable_to_non_nullable
as String?,class_: freezed == class_ ? _self.class_ : class_ // ignore: cast_nullable_to_non_nullable
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String?,place_rank: freezed == place_rank ? _self.place_rank : place_rank // ignore: cast_nullable_to_non_nullable
as int?,importance: freezed == importance ? _self.importance : importance // ignore: cast_nullable_to_non_nullable
as double?,addresstype: freezed == addresstype ? _self.addresstype : addresstype // ignore: cast_nullable_to_non_nullable
as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,display_name: freezed == display_name ? _self.display_name : display_name // ignore: cast_nullable_to_non_nullable
as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as Address?,boundingbox: freezed == boundingbox ? _self._boundingbox : boundingbox // ignore: cast_nullable_to_non_nullable
as List<String>?,
));
}
/// Create a copy of LocationDetails
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AddressCopyWith<$Res>? get address {
if (_self.address == null) {
return null;
}
return $AddressCopyWith<$Res>(_self.address!, (value) {
return _then(_self.copyWith(address: value));
});
}
}
// dart format on

View File

@@ -0,0 +1,81 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'address.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
road: json['road'] as String?,
neighbourhood: json['neighbourhood'] as String?,
suburb: json['suburb'] as String?,
state: json['state'] as String?,
borough: json['borough'] as String?,
city: json['city'] as String?,
district: json['district'] as String?,
county: json['county'] as String?,
province: json['province'] as String?,
ISO3166_2_lvl4: json['ISO3166_2_lvl4'] as String?,
postcode: json['postcode'] as String?,
country: json['country'] as String?,
country_code: json['country_code'] as String?,
);
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
'road': instance.road,
'neighbourhood': instance.neighbourhood,
'suburb': instance.suburb,
'state': instance.state,
'borough': instance.borough,
'city': instance.city,
'district': instance.district,
'county': instance.county,
'province': instance.province,
'ISO3166_2_lvl4': instance.ISO3166_2_lvl4,
'postcode': instance.postcode,
'country': instance.country,
'country_code': instance.country_code,
};
_LocationDetails _$LocationDetailsFromJson(Map<String, dynamic> json) =>
_LocationDetails(
place_id: (json['place_id'] as num?)?.toInt(),
licence: json['licence'] as String?,
osm_type: json['osm_type'] as String?,
osm_id: (json['osm_id'] as num?)?.toInt(),
lat: json['lat'] as String?,
lon: json['lon'] as String?,
class_: json['class_'] as String?,
type: json['type'] as String?,
place_rank: (json['place_rank'] as num?)?.toInt(),
importance: (json['importance'] as num?)?.toDouble(),
addresstype: json['addresstype'] as String?,
name: json['name'] as String?,
display_name: json['display_name'] as String?,
address: json['address'] == null
? null
: Address.fromJson(json['address'] as Map<String, dynamic>),
boundingbox: (json['boundingbox'] as List<dynamic>?)
?.map((e) => e as String)
.toList(),
);
Map<String, dynamic> _$LocationDetailsToJson(_LocationDetails instance) =>
<String, dynamic>{
'place_id': instance.place_id,
'licence': instance.licence,
'osm_type': instance.osm_type,
'osm_id': instance.osm_id,
'lat': instance.lat,
'lon': instance.lon,
'class_': instance.class_,
'type': instance.type,
'place_rank': instance.place_rank,
'importance': instance.importance,
'addresstype': instance.addresstype,
'name': instance.name,
'display_name': instance.display_name,
'address': instance.address,
'boundingbox': instance.boundingbox,
};

View File

@@ -23,6 +23,9 @@ class BasePage extends StatefulWidget {
this.onFilterTap,
this.onSearchTap,
this.filteringWidget,
this.title,
this.padding,
this.avoidBottomInset = true,
});
final List<String>? routes;
@@ -37,9 +40,13 @@ class BasePage extends StatefulWidget {
final bool hasFilter;
final bool hasSearch;
final bool isBase;
final bool avoidBottomInset;
final VoidCallback? onBackPressed;
final GestureTapCallback? onFilterTap;
final GestureTapCallback? onSearchTap;
final String? title;
final EdgeInsets? padding;
@override
State<BasePage> createState() => _BasePageState();
@@ -115,7 +122,9 @@ class _BasePageState extends State<BasePage> {
onPopInvokedWithResult: (didPop, result) => widget.onBackPressed,
child: Scaffold(
backgroundColor: AppColor.bgLight,
resizeToAvoidBottomInset: widget.avoidBottomInset,
appBar: liveStockAppBar(
title: widget.title,
hasBack: widget.isBase ? false : widget.hasBack,
onBackPressed: widget.onBackPressed,
hasFilter: widget.hasFilter,
@@ -124,15 +133,18 @@ class _BasePageState extends State<BasePage> {
onFilterTap: widget.hasFilter ? _onFilterTap : null,
onSearchTap: widget.hasSearch ? () => controller.toggleSearch() : null,
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//widget.routesWidget != null ? widget.routesWidget! : buildPageRoute(widget.routes!),
if (!widget.isBase && widget.hasSearch && widget.defaultSearch) ...{
SearchWidget(onSearchChanged: widget.onSearchChanged),
},
...widget.widgets,
],
body: Padding(
padding: widget.padding ?? const EdgeInsets.all(0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//widget.routesWidget != null ? widget.routesWidget! : buildPageRoute(widget.routes!),
if (!widget.isBase && widget.hasSearch && widget.defaultSearch) ...{
SearchWidget(onSearchChanged: widget.onSearchChanged),
},
...widget.widgets,
],
),
),
floatingActionButtonLocation:
widget.floatingActionButtonLocation ?? FloatingActionButtonLocation.startFloat,