279 lines
7.7 KiB
Dart
279 lines
7.7 KiB
Dart
// 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 'trip.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// dart format off
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$Trip {
|
|
|
|
String get uuid; set uuid(String value);// Duration totalTime,
|
|
/// total time in minutes
|
|
int? get totalTimeMinutes;// Duration totalTime,
|
|
/// total time in minutes
|
|
set totalTimeMinutes(int? value);/// ordered list of landmarks in this trip
|
|
List<Landmark> get landmarks;/// ordered list of landmarks in this trip
|
|
set landmarks(List<Landmark> value);
|
|
/// Create a copy of Trip
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$TripCopyWith<Trip> get copyWith => _$TripCopyWithImpl<Trip>(this as Trip, _$identity);
|
|
|
|
/// Serializes this Trip to a JSON map.
|
|
Map<String, dynamic> toJson();
|
|
|
|
|
|
|
|
|
|
@override
|
|
String toString() {
|
|
return 'Trip(uuid: $uuid, totalTimeMinutes: $totalTimeMinutes, landmarks: $landmarks)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $TripCopyWith<$Res> {
|
|
factory $TripCopyWith(Trip value, $Res Function(Trip) _then) = _$TripCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
String uuid, int? totalTimeMinutes, List<Landmark> landmarks
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$TripCopyWithImpl<$Res>
|
|
implements $TripCopyWith<$Res> {
|
|
_$TripCopyWithImpl(this._self, this._then);
|
|
|
|
final Trip _self;
|
|
final $Res Function(Trip) _then;
|
|
|
|
/// Create a copy of Trip
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? uuid = null,Object? totalTimeMinutes = freezed,Object? landmarks = null,}) {
|
|
return _then(_self.copyWith(
|
|
uuid: null == uuid ? _self.uuid : uuid // ignore: cast_nullable_to_non_nullable
|
|
as String,totalTimeMinutes: freezed == totalTimeMinutes ? _self.totalTimeMinutes : totalTimeMinutes // ignore: cast_nullable_to_non_nullable
|
|
as int?,landmarks: null == landmarks ? _self.landmarks : landmarks // ignore: cast_nullable_to_non_nullable
|
|
as List<Landmark>,
|
|
));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/// Adds pattern-matching-related methods to [Trip].
|
|
extension TripPatterns on Trip {
|
|
/// 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( _Trip value)? $default,{required TResult orElse(),}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _Trip() 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( _Trip value) $default,){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _Trip():
|
|
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( _Trip value)? $default,){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _Trip() 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 uuid, int? totalTimeMinutes, List<Landmark> landmarks)? $default,{required TResult orElse(),}) {final _that = this;
|
|
switch (_that) {
|
|
case _Trip() when $default != null:
|
|
return $default(_that.uuid,_that.totalTimeMinutes,_that.landmarks);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 uuid, int? totalTimeMinutes, List<Landmark> landmarks) $default,) {final _that = this;
|
|
switch (_that) {
|
|
case _Trip():
|
|
return $default(_that.uuid,_that.totalTimeMinutes,_that.landmarks);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 uuid, int? totalTimeMinutes, List<Landmark> landmarks)? $default,) {final _that = this;
|
|
switch (_that) {
|
|
case _Trip() when $default != null:
|
|
return $default(_that.uuid,_that.totalTimeMinutes,_that.landmarks);case _:
|
|
return null;
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
|
|
class _Trip implements Trip {
|
|
_Trip({required this.uuid, this.totalTimeMinutes, required this.landmarks});
|
|
factory _Trip.fromJson(Map<String, dynamic> json) => _$TripFromJson(json);
|
|
|
|
@override String uuid;
|
|
// Duration totalTime,
|
|
/// total time in minutes
|
|
@override int? totalTimeMinutes;
|
|
/// ordered list of landmarks in this trip
|
|
@override List<Landmark> landmarks;
|
|
|
|
/// Create a copy of Trip
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$TripCopyWith<_Trip> get copyWith => __$TripCopyWithImpl<_Trip>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$TripToJson(this, );
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
String toString() {
|
|
return 'Trip(uuid: $uuid, totalTimeMinutes: $totalTimeMinutes, landmarks: $landmarks)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$TripCopyWith<$Res> implements $TripCopyWith<$Res> {
|
|
factory _$TripCopyWith(_Trip value, $Res Function(_Trip) _then) = __$TripCopyWithImpl;
|
|
@override @useResult
|
|
$Res call({
|
|
String uuid, int? totalTimeMinutes, List<Landmark> landmarks
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class __$TripCopyWithImpl<$Res>
|
|
implements _$TripCopyWith<$Res> {
|
|
__$TripCopyWithImpl(this._self, this._then);
|
|
|
|
final _Trip _self;
|
|
final $Res Function(_Trip) _then;
|
|
|
|
/// Create a copy of Trip
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? uuid = null,Object? totalTimeMinutes = freezed,Object? landmarks = null,}) {
|
|
return _then(_Trip(
|
|
uuid: null == uuid ? _self.uuid : uuid // ignore: cast_nullable_to_non_nullable
|
|
as String,totalTimeMinutes: freezed == totalTimeMinutes ? _self.totalTimeMinutes : totalTimeMinutes // ignore: cast_nullable_to_non_nullable
|
|
as int?,landmarks: null == landmarks ? _self.landmarks : landmarks // ignore: cast_nullable_to_non_nullable
|
|
as List<Landmark>,
|
|
));
|
|
}
|
|
|
|
|
|
}
|
|
|
|
// dart format on
|