Kenneth Bruen
2 years ago
49 changed files with 1641 additions and 318 deletions
@ -0,0 +1,13 @@
|
||||
export 'package:info_tren/models/changelog_entry.dart'; |
||||
export 'package:info_tren/models/station_arrdep.dart'; |
||||
export 'package:info_tren/models/station_data.dart'; |
||||
export 'package:info_tren/models/station_status.dart'; |
||||
export 'package:info_tren/models/station_train.dart'; |
||||
export 'package:info_tren/models/stations_result.dart'; |
||||
export 'package:info_tren/models/train_data.dart' hide State; |
||||
export 'package:info_tren/models/trains_result.dart'; |
||||
export 'package:info_tren/models/ui_design.dart'; |
||||
|
||||
import 'package:info_tren/models/train_data.dart' show State; |
||||
|
||||
typedef TrainDataState = State; |
@ -0,0 +1,18 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart'; |
||||
import 'package:info_tren/models.dart'; |
||||
|
||||
part 'station_arrdep.g.dart'; |
||||
part 'station_arrdep.freezed.dart'; |
||||
|
||||
@freezed |
||||
class StationArrDep with _$StationArrDep { |
||||
const factory StationArrDep({ |
||||
required int? stoppingTime, |
||||
required DateTime time, |
||||
required StationTrain train, |
||||
required StationStatus status, |
||||
}) = _StationArrDep; |
||||
|
||||
factory StationArrDep.fromJson(Map<String, dynamic> json) => _$StationArrDepFromJson(json); |
||||
} |
||||
|
@ -0,0 +1,241 @@
|
||||
// coverage:ignore-file |
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
// 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 |
||||
|
||||
part of 'station_arrdep.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// FreezedGenerator |
||||
// ************************************************************************** |
||||
|
||||
T _$identity<T>(T value) => value; |
||||
|
||||
final _privateConstructorUsedError = UnsupportedError( |
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); |
||||
|
||||
StationArrDep _$StationArrDepFromJson(Map<String, dynamic> json) { |
||||
return _StationArrDep.fromJson(json); |
||||
} |
||||
|
||||
/// @nodoc |
||||
mixin _$StationArrDep { |
||||
int? get stoppingTime => throw _privateConstructorUsedError; |
||||
DateTime get time => throw _privateConstructorUsedError; |
||||
StationTrain get train => throw _privateConstructorUsedError; |
||||
StationStatus get status => throw _privateConstructorUsedError; |
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; |
||||
@JsonKey(ignore: true) |
||||
$StationArrDepCopyWith<StationArrDep> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class $StationArrDepCopyWith<$Res> { |
||||
factory $StationArrDepCopyWith( |
||||
StationArrDep value, $Res Function(StationArrDep) then) = |
||||
_$StationArrDepCopyWithImpl<$Res, StationArrDep>; |
||||
@useResult |
||||
$Res call( |
||||
{int? stoppingTime, |
||||
DateTime time, |
||||
StationTrain train, |
||||
StationStatus status}); |
||||
|
||||
$StationTrainCopyWith<$Res> get train; |
||||
$StationStatusCopyWith<$Res> get status; |
||||
} |
||||
|
||||
/// @nodoc |
||||
class _$StationArrDepCopyWithImpl<$Res, $Val extends StationArrDep> |
||||
implements $StationArrDepCopyWith<$Res> { |
||||
_$StationArrDepCopyWithImpl(this._value, this._then); |
||||
|
||||
// ignore: unused_field |
||||
final $Val _value; |
||||
// ignore: unused_field |
||||
final $Res Function($Val) _then; |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? stoppingTime = freezed, |
||||
Object? time = null, |
||||
Object? train = null, |
||||
Object? status = null, |
||||
}) { |
||||
return _then(_value.copyWith( |
||||
stoppingTime: freezed == stoppingTime |
||||
? _value.stoppingTime |
||||
: stoppingTime // ignore: cast_nullable_to_non_nullable |
||||
as int?, |
||||
time: null == time |
||||
? _value.time |
||||
: time // ignore: cast_nullable_to_non_nullable |
||||
as DateTime, |
||||
train: null == train |
||||
? _value.train |
||||
: train // ignore: cast_nullable_to_non_nullable |
||||
as StationTrain, |
||||
status: null == status |
||||
? _value.status |
||||
: status // ignore: cast_nullable_to_non_nullable |
||||
as StationStatus, |
||||
) as $Val); |
||||
} |
||||
|
||||
@override |
||||
@pragma('vm:prefer-inline') |
||||
$StationTrainCopyWith<$Res> get train { |
||||
return $StationTrainCopyWith<$Res>(_value.train, (value) { |
||||
return _then(_value.copyWith(train: value) as $Val); |
||||
}); |
||||
} |
||||
|
||||
@override |
||||
@pragma('vm:prefer-inline') |
||||
$StationStatusCopyWith<$Res> get status { |
||||
return $StationStatusCopyWith<$Res>(_value.status, (value) { |
||||
return _then(_value.copyWith(status: value) as $Val); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class _$$_StationArrDepCopyWith<$Res> |
||||
implements $StationArrDepCopyWith<$Res> { |
||||
factory _$$_StationArrDepCopyWith( |
||||
_$_StationArrDep value, $Res Function(_$_StationArrDep) then) = |
||||
__$$_StationArrDepCopyWithImpl<$Res>; |
||||
@override |
||||
@useResult |
||||
$Res call( |
||||
{int? stoppingTime, |
||||
DateTime time, |
||||
StationTrain train, |
||||
StationStatus status}); |
||||
|
||||
@override |
||||
$StationTrainCopyWith<$Res> get train; |
||||
@override |
||||
$StationStatusCopyWith<$Res> get status; |
||||
} |
||||
|
||||
/// @nodoc |
||||
class __$$_StationArrDepCopyWithImpl<$Res> |
||||
extends _$StationArrDepCopyWithImpl<$Res, _$_StationArrDep> |
||||
implements _$$_StationArrDepCopyWith<$Res> { |
||||
__$$_StationArrDepCopyWithImpl( |
||||
_$_StationArrDep _value, $Res Function(_$_StationArrDep) _then) |
||||
: super(_value, _then); |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? stoppingTime = freezed, |
||||
Object? time = null, |
||||
Object? train = null, |
||||
Object? status = null, |
||||
}) { |
||||
return _then(_$_StationArrDep( |
||||
stoppingTime: freezed == stoppingTime |
||||
? _value.stoppingTime |
||||
: stoppingTime // ignore: cast_nullable_to_non_nullable |
||||
as int?, |
||||
time: null == time |
||||
? _value.time |
||||
: time // ignore: cast_nullable_to_non_nullable |
||||
as DateTime, |
||||
train: null == train |
||||
? _value.train |
||||
: train // ignore: cast_nullable_to_non_nullable |
||||
as StationTrain, |
||||
status: null == status |
||||
? _value.status |
||||
: status // ignore: cast_nullable_to_non_nullable |
||||
as StationStatus, |
||||
)); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
@JsonSerializable() |
||||
class _$_StationArrDep implements _StationArrDep { |
||||
const _$_StationArrDep( |
||||
{required this.stoppingTime, |
||||
required this.time, |
||||
required this.train, |
||||
required this.status}); |
||||
|
||||
factory _$_StationArrDep.fromJson(Map<String, dynamic> json) => |
||||
_$$_StationArrDepFromJson(json); |
||||
|
||||
@override |
||||
final int? stoppingTime; |
||||
@override |
||||
final DateTime time; |
||||
@override |
||||
final StationTrain train; |
||||
@override |
||||
final StationStatus status; |
||||
|
||||
@override |
||||
String toString() { |
||||
return 'StationArrDep(stoppingTime: $stoppingTime, time: $time, train: $train, status: $status)'; |
||||
} |
||||
|
||||
@override |
||||
bool operator ==(dynamic other) { |
||||
return identical(this, other) || |
||||
(other.runtimeType == runtimeType && |
||||
other is _$_StationArrDep && |
||||
(identical(other.stoppingTime, stoppingTime) || |
||||
other.stoppingTime == stoppingTime) && |
||||
(identical(other.time, time) || other.time == time) && |
||||
(identical(other.train, train) || other.train == train) && |
||||
(identical(other.status, status) || other.status == status)); |
||||
} |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
int get hashCode => |
||||
Object.hash(runtimeType, stoppingTime, time, train, status); |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
@pragma('vm:prefer-inline') |
||||
_$$_StationArrDepCopyWith<_$_StationArrDep> get copyWith => |
||||
__$$_StationArrDepCopyWithImpl<_$_StationArrDep>(this, _$identity); |
||||
|
||||
@override |
||||
Map<String, dynamic> toJson() { |
||||
return _$$_StationArrDepToJson( |
||||
this, |
||||
); |
||||
} |
||||
} |
||||
|
||||
abstract class _StationArrDep implements StationArrDep { |
||||
const factory _StationArrDep( |
||||
{required final int? stoppingTime, |
||||
required final DateTime time, |
||||
required final StationTrain train, |
||||
required final StationStatus status}) = _$_StationArrDep; |
||||
|
||||
factory _StationArrDep.fromJson(Map<String, dynamic> json) = |
||||
_$_StationArrDep.fromJson; |
||||
|
||||
@override |
||||
int? get stoppingTime; |
||||
@override |
||||
DateTime get time; |
||||
@override |
||||
StationTrain get train; |
||||
@override |
||||
StationStatus get status; |
||||
@override |
||||
@JsonKey(ignore: true) |
||||
_$$_StationArrDepCopyWith<_$_StationArrDep> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
@ -0,0 +1,23 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
|
||||
part of 'station_arrdep.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// JsonSerializableGenerator |
||||
// ************************************************************************** |
||||
|
||||
_$_StationArrDep _$$_StationArrDepFromJson(Map<String, dynamic> json) => |
||||
_$_StationArrDep( |
||||
stoppingTime: json['stoppingTime'] as int?, |
||||
time: DateTime.parse(json['time'] as String), |
||||
train: StationTrain.fromJson(json['train'] as Map<String, dynamic>), |
||||
status: StationStatus.fromJson(json['status'] as Map<String, dynamic>), |
||||
); |
||||
|
||||
Map<String, dynamic> _$$_StationArrDepToJson(_$_StationArrDep instance) => |
||||
<String, dynamic>{ |
||||
'stoppingTime': instance.stoppingTime, |
||||
'time': instance.time.toIso8601String(), |
||||
'train': instance.train, |
||||
'status': instance.status, |
||||
}; |
@ -1,64 +1,17 @@
|
||||
import 'package:json_annotation/json_annotation.dart'; |
||||
import 'package:freezed_annotation/freezed_annotation.dart'; |
||||
import 'package:info_tren/models.dart'; |
||||
|
||||
part 'station_data.g.dart'; |
||||
part 'station_data.freezed.dart'; |
||||
|
||||
@JsonSerializable() |
||||
class StationData { |
||||
final String date; |
||||
final String stationName; |
||||
final List<StationArrDep>? arrivals; |
||||
final List<StationArrDep>? departures; |
||||
|
||||
const StationData({required this.date, required this.stationName, required this.arrivals, required this.departures}); |
||||
@freezed |
||||
class StationData with _$StationData { |
||||
const factory StationData({ |
||||
required String date, |
||||
required String stationName, |
||||
required List<StationArrDep>? arrivals, |
||||
required List<StationArrDep>? departures, |
||||
}) = _StationData; |
||||
|
||||
factory StationData.fromJson(Map<String, dynamic> json) => _$StationDataFromJson(json); |
||||
Map<String, dynamic> toJson() => _$StationDataToJson(this); |
||||
} |
||||
|
||||
@JsonSerializable() |
||||
class StationArrDep { |
||||
final int? stoppingTime; |
||||
final DateTime time; |
||||
final StationTrain train; |
||||
final StationStatus status; |
||||
|
||||
const StationArrDep({required this.stoppingTime, required this.time, required this.train, required this.status,}); |
||||
|
||||
factory StationArrDep.fromJson(Map<String, dynamic> json) => _$StationArrDepFromJson(json); |
||||
Map<String, dynamic> toJson() => _$StationArrDepToJson(this); |
||||
} |
||||
|
||||
@JsonSerializable() |
||||
class StationTrain { |
||||
final String rank; |
||||
final String number; |
||||
final String operator; |
||||
final String terminus; |
||||
final List<String>? route; |
||||
final DateTime departureDate; |
||||
|
||||
StationTrain({ |
||||
required this.rank, |
||||
required this.number, |
||||
required this.operator, |
||||
required this.terminus, |
||||
this.route, |
||||
required this.departureDate, |
||||
}); |
||||
|
||||
factory StationTrain.fromJson(Map<String, dynamic> json) => _$StationTrainFromJson(json); |
||||
Map<String, dynamic> toJson() => _$StationTrainToJson(this); |
||||
} |
||||
|
||||
@JsonSerializable() |
||||
class StationStatus { |
||||
final int delay; |
||||
final bool real; |
||||
final bool cancelled; |
||||
final String? platform; |
||||
|
||||
StationStatus({required this.delay, required this.real, required this.cancelled, required this.platform}); |
||||
|
||||
factory StationStatus.fromJson(Map<String, dynamic> json) => _$StationStatusFromJson(json); |
||||
Map<String, dynamic> toJson() => _$StationStatusToJson(this); |
||||
} |
||||
|
@ -0,0 +1,237 @@
|
||||
// coverage:ignore-file |
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
// 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 |
||||
|
||||
part of 'station_data.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// FreezedGenerator |
||||
// ************************************************************************** |
||||
|
||||
T _$identity<T>(T value) => value; |
||||
|
||||
final _privateConstructorUsedError = UnsupportedError( |
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); |
||||
|
||||
StationData _$StationDataFromJson(Map<String, dynamic> json) { |
||||
return _StationData.fromJson(json); |
||||
} |
||||
|
||||
/// @nodoc |
||||
mixin _$StationData { |
||||
String get date => throw _privateConstructorUsedError; |
||||
String get stationName => throw _privateConstructorUsedError; |
||||
List<StationArrDep>? get arrivals => throw _privateConstructorUsedError; |
||||
List<StationArrDep>? get departures => throw _privateConstructorUsedError; |
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; |
||||
@JsonKey(ignore: true) |
||||
$StationDataCopyWith<StationData> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class $StationDataCopyWith<$Res> { |
||||
factory $StationDataCopyWith( |
||||
StationData value, $Res Function(StationData) then) = |
||||
_$StationDataCopyWithImpl<$Res, StationData>; |
||||
@useResult |
||||
$Res call( |
||||
{String date, |
||||
String stationName, |
||||
List<StationArrDep>? arrivals, |
||||
List<StationArrDep>? departures}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class _$StationDataCopyWithImpl<$Res, $Val extends StationData> |
||||
implements $StationDataCopyWith<$Res> { |
||||
_$StationDataCopyWithImpl(this._value, this._then); |
||||
|
||||
// ignore: unused_field |
||||
final $Val _value; |
||||
// ignore: unused_field |
||||
final $Res Function($Val) _then; |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? date = null, |
||||
Object? stationName = null, |
||||
Object? arrivals = freezed, |
||||
Object? departures = freezed, |
||||
}) { |
||||
return _then(_value.copyWith( |
||||
date: null == date |
||||
? _value.date |
||||
: date // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
stationName: null == stationName |
||||
? _value.stationName |
||||
: stationName // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
arrivals: freezed == arrivals |
||||
? _value.arrivals |
||||
: arrivals // ignore: cast_nullable_to_non_nullable |
||||
as List<StationArrDep>?, |
||||
departures: freezed == departures |
||||
? _value.departures |
||||
: departures // ignore: cast_nullable_to_non_nullable |
||||
as List<StationArrDep>?, |
||||
) as $Val); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class _$$_StationDataCopyWith<$Res> |
||||
implements $StationDataCopyWith<$Res> { |
||||
factory _$$_StationDataCopyWith( |
||||
_$_StationData value, $Res Function(_$_StationData) then) = |
||||
__$$_StationDataCopyWithImpl<$Res>; |
||||
@override |
||||
@useResult |
||||
$Res call( |
||||
{String date, |
||||
String stationName, |
||||
List<StationArrDep>? arrivals, |
||||
List<StationArrDep>? departures}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class __$$_StationDataCopyWithImpl<$Res> |
||||
extends _$StationDataCopyWithImpl<$Res, _$_StationData> |
||||
implements _$$_StationDataCopyWith<$Res> { |
||||
__$$_StationDataCopyWithImpl( |
||||
_$_StationData _value, $Res Function(_$_StationData) _then) |
||||
: super(_value, _then); |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? date = null, |
||||
Object? stationName = null, |
||||
Object? arrivals = freezed, |
||||
Object? departures = freezed, |
||||
}) { |
||||
return _then(_$_StationData( |
||||
date: null == date |
||||
? _value.date |
||||
: date // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
stationName: null == stationName |
||||
? _value.stationName |
||||
: stationName // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
arrivals: freezed == arrivals |
||||
? _value._arrivals |
||||
: arrivals // ignore: cast_nullable_to_non_nullable |
||||
as List<StationArrDep>?, |
||||
departures: freezed == departures |
||||
? _value._departures |
||||
: departures // ignore: cast_nullable_to_non_nullable |
||||
as List<StationArrDep>?, |
||||
)); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
@JsonSerializable() |
||||
class _$_StationData implements _StationData { |
||||
const _$_StationData( |
||||
{required this.date, |
||||
required this.stationName, |
||||
required final List<StationArrDep>? arrivals, |
||||
required final List<StationArrDep>? departures}) |
||||
: _arrivals = arrivals, |
||||
_departures = departures; |
||||
|
||||
factory _$_StationData.fromJson(Map<String, dynamic> json) => |
||||
_$$_StationDataFromJson(json); |
||||
|
||||
@override |
||||
final String date; |
||||
@override |
||||
final String stationName; |
||||
final List<StationArrDep>? _arrivals; |
||||
@override |
||||
List<StationArrDep>? get arrivals { |
||||
final value = _arrivals; |
||||
if (value == null) return null; |
||||
// ignore: implicit_dynamic_type |
||||
return EqualUnmodifiableListView(value); |
||||
} |
||||
|
||||
final List<StationArrDep>? _departures; |
||||
@override |
||||
List<StationArrDep>? get departures { |
||||
final value = _departures; |
||||
if (value == null) return null; |
||||
// ignore: implicit_dynamic_type |
||||
return EqualUnmodifiableListView(value); |
||||
} |
||||
|
||||
@override |
||||
String toString() { |
||||
return 'StationData(date: $date, stationName: $stationName, arrivals: $arrivals, departures: $departures)'; |
||||
} |
||||
|
||||
@override |
||||
bool operator ==(dynamic other) { |
||||
return identical(this, other) || |
||||
(other.runtimeType == runtimeType && |
||||
other is _$_StationData && |
||||
(identical(other.date, date) || other.date == date) && |
||||
(identical(other.stationName, stationName) || |
||||
other.stationName == stationName) && |
||||
const DeepCollectionEquality().equals(other._arrivals, _arrivals) && |
||||
const DeepCollectionEquality() |
||||
.equals(other._departures, _departures)); |
||||
} |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
int get hashCode => Object.hash( |
||||
runtimeType, |
||||
date, |
||||
stationName, |
||||
const DeepCollectionEquality().hash(_arrivals), |
||||
const DeepCollectionEquality().hash(_departures)); |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
@pragma('vm:prefer-inline') |
||||
_$$_StationDataCopyWith<_$_StationData> get copyWith => |
||||
__$$_StationDataCopyWithImpl<_$_StationData>(this, _$identity); |
||||
|
||||
@override |
||||
Map<String, dynamic> toJson() { |
||||
return _$$_StationDataToJson( |
||||
this, |
||||
); |
||||
} |
||||
} |
||||
|
||||
abstract class _StationData implements StationData { |
||||
const factory _StationData( |
||||
{required final String date, |
||||
required final String stationName, |
||||
required final List<StationArrDep>? arrivals, |
||||
required final List<StationArrDep>? departures}) = _$_StationData; |
||||
|
||||
factory _StationData.fromJson(Map<String, dynamic> json) = |
||||
_$_StationData.fromJson; |
||||
|
||||
@override |
||||
String get date; |
||||
@override |
||||
String get stationName; |
||||
@override |
||||
List<StationArrDep>? get arrivals; |
||||
@override |
||||
List<StationArrDep>? get departures; |
||||
@override |
||||
@JsonKey(ignore: true) |
||||
_$$_StationDataCopyWith<_$_StationData> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
@ -0,0 +1,17 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart'; |
||||
|
||||
part 'station_status.g.dart'; |
||||
part 'station_status.freezed.dart'; |
||||
|
||||
@freezed |
||||
class StationStatus with _$StationStatus { |
||||
const factory StationStatus({ |
||||
required int delay, |
||||
required bool real, |
||||
required bool cancelled, |
||||
required String? platform, |
||||
}) = _StationStatus; |
||||
|
||||
factory StationStatus.fromJson(Map<String, dynamic> json) => _$StationStatusFromJson(json); |
||||
} |
||||
|
@ -0,0 +1,210 @@
|
||||
// coverage:ignore-file |
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
// 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 |
||||
|
||||
part of 'station_status.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// FreezedGenerator |
||||
// ************************************************************************** |
||||
|
||||
T _$identity<T>(T value) => value; |
||||
|
||||
final _privateConstructorUsedError = UnsupportedError( |
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); |
||||
|
||||
StationStatus _$StationStatusFromJson(Map<String, dynamic> json) { |
||||
return _StationStatus.fromJson(json); |
||||
} |
||||
|
||||
/// @nodoc |
||||
mixin _$StationStatus { |
||||
int get delay => throw _privateConstructorUsedError; |
||||
bool get real => throw _privateConstructorUsedError; |
||||
bool get cancelled => throw _privateConstructorUsedError; |
||||
String? get platform => throw _privateConstructorUsedError; |
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; |
||||
@JsonKey(ignore: true) |
||||
$StationStatusCopyWith<StationStatus> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class $StationStatusCopyWith<$Res> { |
||||
factory $StationStatusCopyWith( |
||||
StationStatus value, $Res Function(StationStatus) then) = |
||||
_$StationStatusCopyWithImpl<$Res, StationStatus>; |
||||
@useResult |
||||
$Res call({int delay, bool real, bool cancelled, String? platform}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class _$StationStatusCopyWithImpl<$Res, $Val extends StationStatus> |
||||
implements $StationStatusCopyWith<$Res> { |
||||
_$StationStatusCopyWithImpl(this._value, this._then); |
||||
|
||||
// ignore: unused_field |
||||
final $Val _value; |
||||
// ignore: unused_field |
||||
final $Res Function($Val) _then; |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? delay = null, |
||||
Object? real = null, |
||||
Object? cancelled = null, |
||||
Object? platform = freezed, |
||||
}) { |
||||
return _then(_value.copyWith( |
||||
delay: null == delay |
||||
? _value.delay |
||||
: delay // ignore: cast_nullable_to_non_nullable |
||||
as int, |
||||
real: null == real |
||||
? _value.real |
||||
: real // ignore: cast_nullable_to_non_nullable |
||||
as bool, |
||||
cancelled: null == cancelled |
||||
? _value.cancelled |
||||
: cancelled // ignore: cast_nullable_to_non_nullable |
||||
as bool, |
||||
platform: freezed == platform |
||||
? _value.platform |
||||
: platform // ignore: cast_nullable_to_non_nullable |
||||
as String?, |
||||
) as $Val); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class _$$_StationStatusCopyWith<$Res> |
||||
implements $StationStatusCopyWith<$Res> { |
||||
factory _$$_StationStatusCopyWith( |
||||
_$_StationStatus value, $Res Function(_$_StationStatus) then) = |
||||
__$$_StationStatusCopyWithImpl<$Res>; |
||||
@override |
||||
@useResult |
||||
$Res call({int delay, bool real, bool cancelled, String? platform}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class __$$_StationStatusCopyWithImpl<$Res> |
||||
extends _$StationStatusCopyWithImpl<$Res, _$_StationStatus> |
||||
implements _$$_StationStatusCopyWith<$Res> { |
||||
__$$_StationStatusCopyWithImpl( |
||||
_$_StationStatus _value, $Res Function(_$_StationStatus) _then) |
||||
: super(_value, _then); |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? delay = null, |
||||
Object? real = null, |
||||
Object? cancelled = null, |
||||
Object? platform = freezed, |
||||
}) { |
||||
return _then(_$_StationStatus( |
||||
delay: null == delay |
||||
? _value.delay |
||||
: delay // ignore: cast_nullable_to_non_nullable |
||||
as int, |
||||
real: null == real |
||||
? _value.real |
||||
: real // ignore: cast_nullable_to_non_nullable |
||||
as bool, |
||||
cancelled: null == cancelled |
||||
? _value.cancelled |
||||
: cancelled // ignore: cast_nullable_to_non_nullable |
||||
as bool, |
||||
platform: freezed == platform |
||||
? _value.platform |
||||
: platform // ignore: cast_nullable_to_non_nullable |
||||
as String?, |
||||
)); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
@JsonSerializable() |
||||
class _$_StationStatus implements _StationStatus { |
||||
const _$_StationStatus( |
||||
{required this.delay, |
||||
required this.real, |
||||
required this.cancelled, |
||||
required this.platform}); |
||||
|
||||
factory _$_StationStatus.fromJson(Map<String, dynamic> json) => |
||||
_$$_StationStatusFromJson(json); |
||||
|
||||
@override |
||||
final int delay; |
||||
@override |
||||
final bool real; |
||||
@override |
||||
final bool cancelled; |
||||
@override |
||||
final String? platform; |
||||
|
||||
@override |
||||
String toString() { |
||||
return 'StationStatus(delay: $delay, real: $real, cancelled: $cancelled, platform: $platform)'; |
||||
} |
||||
|
||||
@override |
||||
bool operator ==(dynamic other) { |
||||
return identical(this, other) || |
||||
(other.runtimeType == runtimeType && |
||||
other is _$_StationStatus && |
||||
(identical(other.delay, delay) || other.delay == delay) && |
||||
(identical(other.real, real) || other.real == real) && |
||||
(identical(other.cancelled, cancelled) || |
||||
other.cancelled == cancelled) && |
||||
(identical(other.platform, platform) || |
||||
other.platform == platform)); |
||||
} |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
int get hashCode => |
||||
Object.hash(runtimeType, delay, real, cancelled, platform); |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
@pragma('vm:prefer-inline') |
||||
_$$_StationStatusCopyWith<_$_StationStatus> get copyWith => |
||||
__$$_StationStatusCopyWithImpl<_$_StationStatus>(this, _$identity); |
||||
|
||||
@override |
||||
Map<String, dynamic> toJson() { |
||||
return _$$_StationStatusToJson( |
||||
this, |
||||
); |
||||
} |
||||
} |
||||
|
||||
abstract class _StationStatus implements StationStatus { |
||||
const factory _StationStatus( |
||||
{required final int delay, |
||||
required final bool real, |
||||
required final bool cancelled, |
||||
required final String? platform}) = _$_StationStatus; |
||||
|
||||
factory _StationStatus.fromJson(Map<String, dynamic> json) = |
||||
_$_StationStatus.fromJson; |
||||
|
||||
@override |
||||
int get delay; |
||||
@override |
||||
bool get real; |
||||
@override |
||||
bool get cancelled; |
||||
@override |
||||
String? get platform; |
||||
@override |
||||
@JsonKey(ignore: true) |
||||
_$$_StationStatusCopyWith<_$_StationStatus> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
@ -0,0 +1,23 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
|
||||
part of 'station_status.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// JsonSerializableGenerator |
||||
// ************************************************************************** |
||||
|
||||
_$_StationStatus _$$_StationStatusFromJson(Map<String, dynamic> json) => |
||||
_$_StationStatus( |
||||
delay: json['delay'] as int, |
||||
real: json['real'] as bool, |
||||
cancelled: json['cancelled'] as bool, |
||||
platform: json['platform'] as String?, |
||||
); |
||||
|
||||
Map<String, dynamic> _$$_StationStatusToJson(_$_StationStatus instance) => |
||||
<String, dynamic>{ |
||||
'delay': instance.delay, |
||||
'real': instance.real, |
||||
'cancelled': instance.cancelled, |
||||
'platform': instance.platform, |
||||
}; |
@ -0,0 +1,19 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart'; |
||||
|
||||
part 'station_train.g.dart'; |
||||
part 'station_train.freezed.dart'; |
||||
|
||||
@freezed |
||||
class StationTrain with _$StationTrain { |
||||
const factory StationTrain({ |
||||
required String rank, |
||||
required String number, |
||||
required String operator, |
||||
required String terminus, |
||||
List<String>? route, |
||||
required DateTime departureDate, |
||||
}) = _StationTrain; |
||||
|
||||
factory StationTrain.fromJson(Map<String, dynamic> json) => _$StationTrainFromJson(json); |
||||
} |
||||
|
@ -0,0 +1,267 @@
|
||||
// coverage:ignore-file |
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
// 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 |
||||
|
||||
part of 'station_train.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// FreezedGenerator |
||||
// ************************************************************************** |
||||
|
||||
T _$identity<T>(T value) => value; |
||||
|
||||
final _privateConstructorUsedError = UnsupportedError( |
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); |
||||
|
||||
StationTrain _$StationTrainFromJson(Map<String, dynamic> json) { |
||||
return _StationTrain.fromJson(json); |
||||
} |
||||
|
||||
/// @nodoc |
||||
mixin _$StationTrain { |
||||
String get rank => throw _privateConstructorUsedError; |
||||
String get number => throw _privateConstructorUsedError; |
||||
String get operator => throw _privateConstructorUsedError; |
||||
String get terminus => throw _privateConstructorUsedError; |
||||
List<String>? get route => throw _privateConstructorUsedError; |
||||
DateTime get departureDate => throw _privateConstructorUsedError; |
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; |
||||
@JsonKey(ignore: true) |
||||
$StationTrainCopyWith<StationTrain> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class $StationTrainCopyWith<$Res> { |
||||
factory $StationTrainCopyWith( |
||||
StationTrain value, $Res Function(StationTrain) then) = |
||||
_$StationTrainCopyWithImpl<$Res, StationTrain>; |
||||
@useResult |
||||
$Res call( |
||||
{String rank, |
||||
String number, |
||||
String operator, |
||||
String terminus, |
||||
List<String>? route, |
||||
DateTime departureDate}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class _$StationTrainCopyWithImpl<$Res, $Val extends StationTrain> |
||||
implements $StationTrainCopyWith<$Res> { |
||||
_$StationTrainCopyWithImpl(this._value, this._then); |
||||
|
||||
// ignore: unused_field |
||||
final $Val _value; |
||||
// ignore: unused_field |
||||
final $Res Function($Val) _then; |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? rank = null, |
||||
Object? number = null, |
||||
Object? operator = null, |
||||
Object? terminus = null, |
||||
Object? route = freezed, |
||||
Object? departureDate = null, |
||||
}) { |
||||
return _then(_value.copyWith( |
||||
rank: null == rank |
||||
? _value.rank |
||||
: rank // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
number: null == number |
||||
? _value.number |
||||
: number // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
operator: null == operator |
||||
? _value.operator |
||||
: operator // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
terminus: null == terminus |
||||
? _value.terminus |
||||
: terminus // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
route: freezed == route |
||||
? _value.route |
||||
: route // ignore: cast_nullable_to_non_nullable |
||||
as List<String>?, |
||||
departureDate: null == departureDate |
||||
? _value.departureDate |
||||
: departureDate // ignore: cast_nullable_to_non_nullable |
||||
as DateTime, |
||||
) as $Val); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class _$$_StationTrainCopyWith<$Res> |
||||
implements $StationTrainCopyWith<$Res> { |
||||
factory _$$_StationTrainCopyWith( |
||||
_$_StationTrain value, $Res Function(_$_StationTrain) then) = |
||||
__$$_StationTrainCopyWithImpl<$Res>; |
||||
@override |
||||
@useResult |
||||
$Res call( |
||||
{String rank, |
||||
String number, |
||||
String operator, |
||||
String terminus, |
||||
List<String>? route, |
||||
DateTime departureDate}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class __$$_StationTrainCopyWithImpl<$Res> |
||||
extends _$StationTrainCopyWithImpl<$Res, _$_StationTrain> |
||||
implements _$$_StationTrainCopyWith<$Res> { |
||||
__$$_StationTrainCopyWithImpl( |
||||
_$_StationTrain _value, $Res Function(_$_StationTrain) _then) |
||||
: super(_value, _then); |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? rank = null, |
||||
Object? number = null, |
||||
Object? operator = null, |
||||
Object? terminus = null, |
||||
Object? route = freezed, |
||||
Object? departureDate = null, |
||||
}) { |
||||
return _then(_$_StationTrain( |
||||
rank: null == rank |
||||
? _value.rank |
||||
: rank // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
number: null == number |
||||
? _value.number |
||||
: number // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
operator: null == operator |
||||
? _value.operator |
||||
: operator // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
terminus: null == terminus |
||||
? _value.terminus |
||||
: terminus // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
route: freezed == route |
||||
? _value._route |
||||
: route // ignore: cast_nullable_to_non_nullable |
||||
as List<String>?, |
||||
departureDate: null == departureDate |
||||
? _value.departureDate |
||||
: departureDate // ignore: cast_nullable_to_non_nullable |
||||
as DateTime, |
||||
)); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
@JsonSerializable() |
||||
class _$_StationTrain implements _StationTrain { |
||||
const _$_StationTrain( |
||||
{required this.rank, |
||||
required this.number, |
||||
required this.operator, |
||||
required this.terminus, |
||||
final List<String>? route, |
||||
required this.departureDate}) |
||||
: _route = route; |
||||
|
||||
factory _$_StationTrain.fromJson(Map<String, dynamic> json) => |
||||
_$$_StationTrainFromJson(json); |
||||
|
||||
@override |
||||
final String rank; |
||||
@override |
||||
final String number; |
||||
@override |
||||
final String operator; |
||||
@override |
||||
final String terminus; |
||||
final List<String>? _route; |
||||
@override |
||||
List<String>? get route { |
||||
final value = _route; |
||||
if (value == null) return null; |
||||
// ignore: implicit_dynamic_type |
||||
return EqualUnmodifiableListView(value); |
||||
} |
||||
|
||||
@override |
||||
final DateTime departureDate; |
||||
|
||||
@override |
||||
String toString() { |
||||
return 'StationTrain(rank: $rank, number: $number, operator: $operator, terminus: $terminus, route: $route, departureDate: $departureDate)'; |
||||
} |
||||
|
||||
@override |
||||
bool operator ==(dynamic other) { |
||||
return identical(this, other) || |
||||
(other.runtimeType == runtimeType && |
||||
other is _$_StationTrain && |
||||
(identical(other.rank, rank) || other.rank == rank) && |
||||
(identical(other.number, number) || other.number == number) && |
||||
(identical(other.operator, operator) || |
||||
other.operator == operator) && |
||||
(identical(other.terminus, terminus) || |
||||
other.terminus == terminus) && |
||||
const DeepCollectionEquality().equals(other._route, _route) && |
||||
(identical(other.departureDate, departureDate) || |
||||
other.departureDate == departureDate)); |
||||
} |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
int get hashCode => Object.hash(runtimeType, rank, number, operator, terminus, |
||||
const DeepCollectionEquality().hash(_route), departureDate); |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
@pragma('vm:prefer-inline') |
||||
_$$_StationTrainCopyWith<_$_StationTrain> get copyWith => |
||||
__$$_StationTrainCopyWithImpl<_$_StationTrain>(this, _$identity); |
||||
|
||||
@override |
||||
Map<String, dynamic> toJson() { |
||||
return _$$_StationTrainToJson( |
||||
this, |
||||
); |
||||
} |
||||
} |
||||
|
||||
abstract class _StationTrain implements StationTrain { |
||||
const factory _StationTrain( |
||||
{required final String rank, |
||||
required final String number, |
||||
required final String operator, |
||||
required final String terminus, |
||||
final List<String>? route, |
||||
required final DateTime departureDate}) = _$_StationTrain; |
||||
|
||||
factory _StationTrain.fromJson(Map<String, dynamic> json) = |
||||
_$_StationTrain.fromJson; |
||||
|
||||
@override |
||||
String get rank; |
||||
@override |
||||
String get number; |
||||
@override |
||||
String get operator; |
||||
@override |
||||
String get terminus; |
||||
@override |
||||
List<String>? get route; |
||||
@override |
||||
DateTime get departureDate; |
||||
@override |
||||
@JsonKey(ignore: true) |
||||
_$$_StationTrainCopyWith<_$_StationTrain> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
@ -0,0 +1,28 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
|
||||
part of 'station_train.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// JsonSerializableGenerator |
||||
// ************************************************************************** |
||||
|
||||
_$_StationTrain _$$_StationTrainFromJson(Map<String, dynamic> json) => |
||||
_$_StationTrain( |
||||
rank: json['rank'] as String, |
||||
number: json['number'] as String, |
||||
operator: json['operator'] as String, |
||||
terminus: json['terminus'] as String, |
||||
route: |
||||
(json['route'] as List<dynamic>?)?.map((e) => e as String).toList(), |
||||
departureDate: DateTime.parse(json['departureDate'] as String), |
||||
); |
||||
|
||||
Map<String, dynamic> _$$_StationTrainToJson(_$_StationTrain instance) => |
||||
<String, dynamic>{ |
||||
'rank': instance.rank, |
||||
'number': instance.number, |
||||
'operator': instance.operator, |
||||
'terminus': instance.terminus, |
||||
'route': instance.route, |
||||
'departureDate': instance.departureDate.toIso8601String(), |
||||
}; |
@ -1,14 +1,14 @@
|
||||
import 'package:json_annotation/json_annotation.dart'; |
||||
import 'package:freezed_annotation/freezed_annotation.dart'; |
||||
|
||||
part 'stations_result.g.dart'; |
||||
part 'stations_result.freezed.dart'; |
||||
|
||||
@JsonSerializable() |
||||
class StationsResult { |
||||
final String name; |
||||
final List<String>? stoppedAtBy; |
||||
|
||||
const StationsResult({required this.name, this.stoppedAtBy}); |
||||
@freezed |
||||
class StationsResult with _$StationsResult { |
||||
const factory StationsResult({ |
||||
required String name, |
||||
List<String>? stoppedAtBy, |
||||
}) = _StationsResult; |
||||
|
||||
factory StationsResult.fromJson(Map<String, dynamic> json) => _$StationsResultFromJson(json); |
||||
Map<String, dynamic> toJson() => _$StationsResultToJson(this); |
||||
} |
||||
|
@ -0,0 +1,178 @@
|
||||
// coverage:ignore-file |
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
// 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 |
||||
|
||||
part of 'stations_result.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// FreezedGenerator |
||||
// ************************************************************************** |
||||
|
||||
T _$identity<T>(T value) => value; |
||||
|
||||
final _privateConstructorUsedError = UnsupportedError( |
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); |
||||
|
||||
StationsResult _$StationsResultFromJson(Map<String, dynamic> json) { |
||||
return _StationsResult.fromJson(json); |
||||
} |
||||
|
||||
/// @nodoc |
||||
mixin _$StationsResult { |
||||
String get name => throw _privateConstructorUsedError; |
||||
List<String>? get stoppedAtBy => throw _privateConstructorUsedError; |
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; |
||||
@JsonKey(ignore: true) |
||||
$StationsResultCopyWith<StationsResult> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class $StationsResultCopyWith<$Res> { |
||||
factory $StationsResultCopyWith( |
||||
StationsResult value, $Res Function(StationsResult) then) = |
||||
_$StationsResultCopyWithImpl<$Res, StationsResult>; |
||||
@useResult |
||||
$Res call({String name, List<String>? stoppedAtBy}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class _$StationsResultCopyWithImpl<$Res, $Val extends StationsResult> |
||||
implements $StationsResultCopyWith<$Res> { |
||||
_$StationsResultCopyWithImpl(this._value, this._then); |
||||
|
||||
// ignore: unused_field |
||||
final $Val _value; |
||||
// ignore: unused_field |
||||
final $Res Function($Val) _then; |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? name = null, |
||||
Object? stoppedAtBy = freezed, |
||||
}) { |
||||
return _then(_value.copyWith( |
||||
name: null == name |
||||
? _value.name |
||||
: name // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
stoppedAtBy: freezed == stoppedAtBy |
||||
? _value.stoppedAtBy |
||||
: stoppedAtBy // ignore: cast_nullable_to_non_nullable |
||||
as List<String>?, |
||||
) as $Val); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class _$$_StationsResultCopyWith<$Res> |
||||
implements $StationsResultCopyWith<$Res> { |
||||
factory _$$_StationsResultCopyWith( |
||||
_$_StationsResult value, $Res Function(_$_StationsResult) then) = |
||||
__$$_StationsResultCopyWithImpl<$Res>; |
||||
@override |
||||
@useResult |
||||
$Res call({String name, List<String>? stoppedAtBy}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class __$$_StationsResultCopyWithImpl<$Res> |
||||
extends _$StationsResultCopyWithImpl<$Res, _$_StationsResult> |
||||
implements _$$_StationsResultCopyWith<$Res> { |
||||
__$$_StationsResultCopyWithImpl( |
||||
_$_StationsResult _value, $Res Function(_$_StationsResult) _then) |
||||
: super(_value, _then); |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? name = null, |
||||
Object? stoppedAtBy = freezed, |
||||
}) { |
||||
return _then(_$_StationsResult( |
||||
name: null == name |
||||
? _value.name |
||||
: name // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
stoppedAtBy: freezed == stoppedAtBy |
||||
? _value._stoppedAtBy |
||||
: stoppedAtBy // ignore: cast_nullable_to_non_nullable |
||||
as List<String>?, |
||||
)); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
@JsonSerializable() |
||||
class _$_StationsResult implements _StationsResult { |
||||
const _$_StationsResult({required this.name, final List<String>? stoppedAtBy}) |
||||
: _stoppedAtBy = stoppedAtBy; |
||||
|
||||
factory _$_StationsResult.fromJson(Map<String, dynamic> json) => |
||||
_$$_StationsResultFromJson(json); |
||||
|
||||
@override |
||||
final String name; |
||||
final List<String>? _stoppedAtBy; |
||||
@override |
||||
List<String>? get stoppedAtBy { |
||||
final value = _stoppedAtBy; |
||||
if (value == null) return null; |
||||
// ignore: implicit_dynamic_type |
||||
return EqualUnmodifiableListView(value); |
||||
} |
||||
|
||||
@override |
||||
String toString() { |
||||
return 'StationsResult(name: $name, stoppedAtBy: $stoppedAtBy)'; |
||||
} |
||||
|
||||
@override |
||||
bool operator ==(dynamic other) { |
||||
return identical(this, other) || |
||||
(other.runtimeType == runtimeType && |
||||
other is _$_StationsResult && |
||||
(identical(other.name, name) || other.name == name) && |
||||
const DeepCollectionEquality() |
||||
.equals(other._stoppedAtBy, _stoppedAtBy)); |
||||
} |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
int get hashCode => Object.hash( |
||||
runtimeType, name, const DeepCollectionEquality().hash(_stoppedAtBy)); |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
@pragma('vm:prefer-inline') |
||||
_$$_StationsResultCopyWith<_$_StationsResult> get copyWith => |
||||
__$$_StationsResultCopyWithImpl<_$_StationsResult>(this, _$identity); |
||||
|
||||
@override |
||||
Map<String, dynamic> toJson() { |
||||
return _$$_StationsResultToJson( |
||||
this, |
||||
); |
||||
} |
||||
} |
||||
|
||||
abstract class _StationsResult implements StationsResult { |
||||
const factory _StationsResult( |
||||
{required final String name, |
||||
final List<String>? stoppedAtBy}) = _$_StationsResult; |
||||
|
||||
factory _StationsResult.fromJson(Map<String, dynamic> json) = |
||||
_$_StationsResult.fromJson; |
||||
|
||||
@override |
||||
String get name; |
||||
@override |
||||
List<String>? get stoppedAtBy; |
||||
@override |
||||
@JsonKey(ignore: true) |
||||
_$$_StationsResultCopyWith<_$_StationsResult> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
@ -1,19 +1,15 @@
|
||||
import 'package:json_annotation/json_annotation.dart'; |
||||
import 'package:freezed_annotation/freezed_annotation.dart'; |
||||
|
||||
part 'trains_result.g.dart'; |
||||
part 'trains_result.freezed.dart'; |
||||
|
||||
@JsonSerializable() |
||||
class TrainsResult { |
||||
final String rank; |
||||
final String number; |
||||
final String company; |
||||
|
||||
const TrainsResult({ |
||||
required this.rank, |
||||
required this.number, |
||||
required this.company, |
||||
}); |
||||
@freezed |
||||
class TrainsResult with _$TrainsResult { |
||||
const factory TrainsResult({ |
||||
required String rank, |
||||
required String number, |
||||
required String company, |
||||
}) = _TrainsResult; |
||||
|
||||
factory TrainsResult.fromJson(Map<String, dynamic> json) => _$TrainsResultFromJson(json); |
||||
Map<String, dynamic> toJson() => _$TrainsResultToJson(this); |
||||
} |
@ -0,0 +1,187 @@
|
||||
// coverage:ignore-file |
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
// 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 |
||||
|
||||
part of 'trains_result.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// FreezedGenerator |
||||
// ************************************************************************** |
||||
|
||||
T _$identity<T>(T value) => value; |
||||
|
||||
final _privateConstructorUsedError = UnsupportedError( |
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); |
||||
|
||||
TrainsResult _$TrainsResultFromJson(Map<String, dynamic> json) { |
||||
return _TrainsResult.fromJson(json); |
||||
} |
||||
|
||||
/// @nodoc |
||||
mixin _$TrainsResult { |
||||
String get rank => throw _privateConstructorUsedError; |
||||
String get number => throw _privateConstructorUsedError; |
||||
String get company => throw _privateConstructorUsedError; |
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; |
||||
@JsonKey(ignore: true) |
||||
$TrainsResultCopyWith<TrainsResult> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class $TrainsResultCopyWith<$Res> { |
||||
factory $TrainsResultCopyWith( |
||||
TrainsResult value, $Res Function(TrainsResult) then) = |
||||
_$TrainsResultCopyWithImpl<$Res, TrainsResult>; |
||||
@useResult |
||||
$Res call({String rank, String number, String company}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class _$TrainsResultCopyWithImpl<$Res, $Val extends TrainsResult> |
||||
implements $TrainsResultCopyWith<$Res> { |
||||
_$TrainsResultCopyWithImpl(this._value, this._then); |
||||
|
||||
// ignore: unused_field |
||||
final $Val _value; |
||||
// ignore: unused_field |
||||
final $Res Function($Val) _then; |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? rank = null, |
||||
Object? number = null, |
||||
Object? company = null, |
||||
}) { |
||||
return _then(_value.copyWith( |
||||
rank: null == rank |
||||
? _value.rank |
||||
: rank // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
number: null == number |
||||
? _value.number |
||||
: number // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
company: null == company |
||||
? _value.company |
||||
: company // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
) as $Val); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
abstract class _$$_TrainsResultCopyWith<$Res> |
||||
implements $TrainsResultCopyWith<$Res> { |
||||
factory _$$_TrainsResultCopyWith( |
||||
_$_TrainsResult value, $Res Function(_$_TrainsResult) then) = |
||||
__$$_TrainsResultCopyWithImpl<$Res>; |
||||
@override |
||||
@useResult |
||||
$Res call({String rank, String number, String company}); |
||||
} |
||||
|
||||
/// @nodoc |
||||
class __$$_TrainsResultCopyWithImpl<$Res> |
||||
extends _$TrainsResultCopyWithImpl<$Res, _$_TrainsResult> |
||||
implements _$$_TrainsResultCopyWith<$Res> { |
||||
__$$_TrainsResultCopyWithImpl( |
||||
_$_TrainsResult _value, $Res Function(_$_TrainsResult) _then) |
||||
: super(_value, _then); |
||||
|
||||
@pragma('vm:prefer-inline') |
||||
@override |
||||
$Res call({ |
||||
Object? rank = null, |
||||
Object? number = null, |
||||
Object? company = null, |
||||
}) { |
||||
return _then(_$_TrainsResult( |
||||
rank: null == rank |
||||
? _value.rank |
||||
: rank // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
number: null == number |
||||
? _value.number |
||||
: number // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
company: null == company |
||||
? _value.company |
||||
: company // ignore: cast_nullable_to_non_nullable |
||||
as String, |
||||
)); |
||||
} |
||||
} |
||||
|
||||
/// @nodoc |
||||
@JsonSerializable() |
||||
class _$_TrainsResult implements _TrainsResult { |
||||
const _$_TrainsResult( |
||||
{required this.rank, required this.number, required this.company}); |
||||
|
||||
factory _$_TrainsResult.fromJson(Map<String, dynamic> json) => |
||||
_$$_TrainsResultFromJson(json); |
||||
|
||||
@override |
||||
final String rank; |
||||
@override |
||||
final String number; |
||||
@override |
||||
final String company; |
||||
|
||||
@override |
||||
String toString() { |
||||
return 'TrainsResult(rank: $rank, number: $number, company: $company)'; |
||||
} |
||||
|
||||
@override |
||||
bool operator ==(dynamic other) { |
||||
return identical(this, other) || |
||||
(other.runtimeType == runtimeType && |
||||
other is _$_TrainsResult && |
||||
(identical(other.rank, rank) || other.rank == rank) && |
||||
(identical(other.number, number) || other.number == number) && |
||||
(identical(other.company, company) || other.company == company)); |
||||
} |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
int get hashCode => Object.hash(runtimeType, rank, number, company); |
||||
|
||||
@JsonKey(ignore: true) |
||||
@override |
||||
@pragma('vm:prefer-inline') |
||||
_$$_TrainsResultCopyWith<_$_TrainsResult> get copyWith => |
||||
__$$_TrainsResultCopyWithImpl<_$_TrainsResult>(this, _$identity); |
||||
|
||||
@override |
||||
Map<String, dynamic> toJson() { |
||||
return _$$_TrainsResultToJson( |
||||
this, |
||||
); |
||||
} |
||||
} |
||||
|
||||
abstract class _TrainsResult implements TrainsResult { |
||||
const factory _TrainsResult( |
||||
{required final String rank, |
||||
required final String number, |
||||
required final String company}) = _$_TrainsResult; |
||||
|
||||
factory _TrainsResult.fromJson(Map<String, dynamic> json) = |
||||
_$_TrainsResult.fromJson; |
||||
|
||||
@override |
||||
String get rank; |
||||
@override |
||||
String get number; |
||||
@override |
||||
String get company; |
||||
@override |
||||
@JsonKey(ignore: true) |
||||
_$$_TrainsResultCopyWith<_$_TrainsResult> get copyWith => |
||||
throw _privateConstructorUsedError; |
||||
} |
@ -1,12 +1,12 @@
|
||||
import 'package:info_tren/models/train_data.dart'; |
||||
import 'package:info_tren/models.dart'; |
||||
|
||||
String stateToString(State state) { |
||||
String stateToString(TrainDataState state) { |
||||
switch(state) { |
||||
case State.PASSING: |
||||
case TrainDataState.PASSING: |
||||
return 'trecere fără oprire'; |
||||
case State.ARRIVAL: |
||||
case TrainDataState.ARRIVAL: |
||||
return 'sosire'; |
||||
case State.DEPARTURE: |
||||
case TrainDataState.DEPARTURE: |
||||
return 'plecare'; |
||||
} |
||||
} |
@ -1,30 +0,0 @@
|
||||
// This is a basic Flutter widget test. |
||||
// |
||||
// To perform an interaction with a widget in your test, use the WidgetTester |
||||
// utility in the flutter_test package. For example, you can send tap and scroll |
||||
// gestures. You can also use WidgetTester to find child widgets in the widget |
||||
// tree, read text, and verify that the values of widget properties are correct. |
||||
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_test/flutter_test.dart'; |
||||
|
||||
import 'package:info_tren/main.dart'; |
||||
|
||||
void main() { |
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async { |
||||
// Build our app and trigger a frame. |
||||
await tester.pumpWidget(const MyApp()); |
||||
|
||||
// Verify that our counter starts at 0. |
||||
expect(find.text('0'), findsOneWidget); |
||||
expect(find.text('1'), findsNothing); |
||||
|
||||
// Tap the '+' icon and trigger a frame. |
||||
await tester.tap(find.byIcon(Icons.add)); |
||||
await tester.pump(); |
||||
|
||||
// Verify that our counter has incremented. |
||||
expect(find.text('0'), findsNothing); |
||||
expect(find.text('1'), findsOneWidget); |
||||
}); |
||||
} |
Loading…
Reference in new issue