Kenneth Bruen
1 year ago
22 changed files with 3754 additions and 656 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,217 @@ |
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||||
|
|
||||||
|
part of 'train_data.dart'; |
||||||
|
|
||||||
|
// ************************************************************************** |
||||||
|
// JsonSerializableGenerator |
||||||
|
// ************************************************************************** |
||||||
|
|
||||||
|
_$_TrainData _$$_TrainDataFromJson(Map<String, dynamic> json) => _$_TrainData( |
||||||
|
rank: json['rank'] as String, |
||||||
|
number: json['number'] as String, |
||||||
|
date: json['date'] as String, |
||||||
|
operator: json['operator'] as String, |
||||||
|
groups: (json['groups'] as List<dynamic>) |
||||||
|
.map((e) => TrainDataGroup.fromJson(e as Map<String, dynamic>)) |
||||||
|
.toList(), |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataToJson(_$_TrainData instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'rank': instance.rank, |
||||||
|
'number': instance.number, |
||||||
|
'date': instance.date, |
||||||
|
'operator': instance.operator, |
||||||
|
'groups': instance.groups, |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataGroup _$$_TrainDataGroupFromJson(Map<String, dynamic> json) => |
||||||
|
_$_TrainDataGroup( |
||||||
|
route: TrainDataRoute.fromJson(json['route'] as Map<String, dynamic>), |
||||||
|
stations: (json['stations'] as List<dynamic>) |
||||||
|
.map((e) => TrainDataStation.fromJson(e as Map<String, dynamic>)) |
||||||
|
.toList(), |
||||||
|
status: json['status'] == null |
||||||
|
? null |
||||||
|
: TrainDataStatus.fromJson(json['status'] as Map<String, dynamic>), |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataGroupToJson(_$_TrainDataGroup instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'route': instance.route, |
||||||
|
'stations': instance.stations, |
||||||
|
'status': instance.status, |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataRoute _$$_TrainDataRouteFromJson(Map<String, dynamic> json) => |
||||||
|
_$_TrainDataRoute( |
||||||
|
from: json['from'] as String, |
||||||
|
to: json['to'] as String, |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataRouteToJson(_$_TrainDataRoute instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'from': instance.from, |
||||||
|
'to': instance.to, |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataStation _$$_TrainDataStationFromJson(Map<String, dynamic> json) => |
||||||
|
_$_TrainDataStation( |
||||||
|
name: json['name'] as String, |
||||||
|
linkName: json['linkName'] as String, |
||||||
|
km: json['km'] as int, |
||||||
|
stoppingTime: json['stoppingTime'] as int?, |
||||||
|
platform: json['platform'] as String?, |
||||||
|
arrival: json['arrival'] == null |
||||||
|
? null |
||||||
|
: StationArrDepTime.fromJson(json['arrival'] as Map<String, dynamic>), |
||||||
|
departure: json['departure'] == null |
||||||
|
? null |
||||||
|
: StationArrDepTime.fromJson( |
||||||
|
json['departure'] as Map<String, dynamic>), |
||||||
|
notes: (json['notes'] as List<dynamic>) |
||||||
|
.map((e) => const TrainDataNoteConverter() |
||||||
|
.fromJson(e as Map<String, dynamic>)) |
||||||
|
.toList(), |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataStationToJson(_$_TrainDataStation instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'name': instance.name, |
||||||
|
'linkName': instance.linkName, |
||||||
|
'km': instance.km, |
||||||
|
'stoppingTime': instance.stoppingTime, |
||||||
|
'platform': instance.platform, |
||||||
|
'arrival': instance.arrival, |
||||||
|
'departure': instance.departure, |
||||||
|
'notes': |
||||||
|
instance.notes.map(const TrainDataNoteConverter().toJson).toList(), |
||||||
|
}; |
||||||
|
|
||||||
|
_$_StationArrDepTime _$$_StationArrDepTimeFromJson(Map<String, dynamic> json) => |
||||||
|
_$_StationArrDepTime( |
||||||
|
scheduleTime: DateTime.parse(json['scheduleTime'] as String), |
||||||
|
status: json['status'] == null |
||||||
|
? null |
||||||
|
: StationArrDepTimeStatus.fromJson( |
||||||
|
json['status'] as Map<String, dynamic>), |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_StationArrDepTimeToJson( |
||||||
|
_$_StationArrDepTime instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'scheduleTime': instance.scheduleTime.toIso8601String(), |
||||||
|
'status': instance.status, |
||||||
|
}; |
||||||
|
|
||||||
|
_$_StationArrDepTimeStatus _$$_StationArrDepTimeStatusFromJson( |
||||||
|
Map<String, dynamic> json) => |
||||||
|
_$_StationArrDepTimeStatus( |
||||||
|
delay: json['delay'] as int, |
||||||
|
real: json['real'] as bool, |
||||||
|
cancelled: json['cancelled'] as bool, |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_StationArrDepTimeStatusToJson( |
||||||
|
_$_StationArrDepTimeStatus instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'delay': instance.delay, |
||||||
|
'real': instance.real, |
||||||
|
'cancelled': instance.cancelled, |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataStatus _$$_TrainDataStatusFromJson(Map<String, dynamic> json) => |
||||||
|
_$_TrainDataStatus( |
||||||
|
delay: json['delay'] as int, |
||||||
|
station: json['station'] as String, |
||||||
|
state: $enumDecode(_$TrainDataStatusStateEnumMap, json['state']), |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataStatusToJson(_$_TrainDataStatus instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'delay': instance.delay, |
||||||
|
'station': instance.station, |
||||||
|
'state': _$TrainDataStatusStateEnumMap[instance.state]!, |
||||||
|
}; |
||||||
|
|
||||||
|
const _$TrainDataStatusStateEnumMap = { |
||||||
|
TrainDataStatusState.passing: 'passing', |
||||||
|
TrainDataStatusState.arrival: 'arrival', |
||||||
|
TrainDataStatusState.departure: 'departure', |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataNoteTrainNumberChange _$$_TrainDataNoteTrainNumberChangeFromJson( |
||||||
|
Map<String, dynamic> json) => |
||||||
|
_$_TrainDataNoteTrainNumberChange( |
||||||
|
kind: json['kind'] as String? ?? "trainNumberChange", |
||||||
|
rank: json['rank'] as String, |
||||||
|
number: json['number'] as String, |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataNoteTrainNumberChangeToJson( |
||||||
|
_$_TrainDataNoteTrainNumberChange instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'kind': instance.kind, |
||||||
|
'rank': instance.rank, |
||||||
|
'number': instance.number, |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataNoteDepartsAs _$$_TrainDataNoteDepartsAsFromJson( |
||||||
|
Map<String, dynamic> json) => |
||||||
|
_$_TrainDataNoteDepartsAs( |
||||||
|
kind: json['kind'] as String? ?? "departsAs", |
||||||
|
rank: json['rank'] as String, |
||||||
|
number: json['number'] as String, |
||||||
|
departureDate: DateTime.parse(json['departureDate'] as String), |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataNoteDepartsAsToJson( |
||||||
|
_$_TrainDataNoteDepartsAs instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'kind': instance.kind, |
||||||
|
'rank': instance.rank, |
||||||
|
'number': instance.number, |
||||||
|
'departureDate': instance.departureDate.toIso8601String(), |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataNoteDetachingWagons _$$_TrainDataNoteDetachingWagonsFromJson( |
||||||
|
Map<String, dynamic> json) => |
||||||
|
_$_TrainDataNoteDetachingWagons( |
||||||
|
kind: json['kind'] as String? ?? "detachingWagons", |
||||||
|
station: json['station'] as String, |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataNoteDetachingWagonsToJson( |
||||||
|
_$_TrainDataNoteDetachingWagons instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'kind': instance.kind, |
||||||
|
'station': instance.station, |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataNoteReceivingWagons _$$_TrainDataNoteReceivingWagonsFromJson( |
||||||
|
Map<String, dynamic> json) => |
||||||
|
_$_TrainDataNoteReceivingWagons( |
||||||
|
kind: json['kind'] as String? ?? "receivingWagons", |
||||||
|
station: json['station'] as String, |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataNoteReceivingWagonsToJson( |
||||||
|
_$_TrainDataNoteReceivingWagons instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'kind': instance.kind, |
||||||
|
'station': instance.station, |
||||||
|
}; |
||||||
|
|
||||||
|
_$_TrainDataNoteUnknown _$$_TrainDataNoteUnknownFromJson( |
||||||
|
Map<String, dynamic> json) => |
||||||
|
_$_TrainDataNoteUnknown( |
||||||
|
kind: json['kind'] as String, |
||||||
|
extra: json['extra'] as Map<String, dynamic>, |
||||||
|
); |
||||||
|
|
||||||
|
Map<String, dynamic> _$$_TrainDataNoteUnknownToJson( |
||||||
|
_$_TrainDataNoteUnknown instance) => |
||||||
|
<String, dynamic>{ |
||||||
|
'kind': instance.kind, |
||||||
|
'extra': instance.extra, |
||||||
|
}; |
@ -0,0 +1,120 @@ |
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||||
|
|
||||||
|
part of 'providers.dart'; |
||||||
|
|
||||||
|
// ************************************************************************** |
||||||
|
// RiverpodGenerator |
||||||
|
// ************************************************************************** |
||||||
|
|
||||||
|
String _$trainInfoHash() => r'd25aabc3ba656acf6497ec6831e11892178b22c9'; |
||||||
|
|
||||||
|
/// Copied from Dart SDK |
||||||
|
class _SystemHash { |
||||||
|
_SystemHash._(); |
||||||
|
|
||||||
|
static int combine(int hash, int value) { |
||||||
|
// ignore: parameter_assignments |
||||||
|
hash = 0x1fffffff & (hash + value); |
||||||
|
// ignore: parameter_assignments |
||||||
|
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); |
||||||
|
return hash ^ (hash >> 6); |
||||||
|
} |
||||||
|
|
||||||
|
static int finish(int hash) { |
||||||
|
// ignore: parameter_assignments |
||||||
|
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); |
||||||
|
// ignore: parameter_assignments |
||||||
|
hash = hash ^ (hash >> 11); |
||||||
|
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
typedef TrainInfoRef = FutureProviderRef<TrainData>; |
||||||
|
|
||||||
|
/// See also [trainInfo]. |
||||||
|
@ProviderFor(trainInfo) |
||||||
|
const trainInfoProvider = TrainInfoFamily(); |
||||||
|
|
||||||
|
/// See also [trainInfo]. |
||||||
|
class TrainInfoFamily extends Family<AsyncValue<TrainData>> { |
||||||
|
/// See also [trainInfo]. |
||||||
|
const TrainInfoFamily(); |
||||||
|
|
||||||
|
/// See also [trainInfo]. |
||||||
|
TrainInfoProvider call({ |
||||||
|
required String trainNumber, |
||||||
|
DateTime? date, |
||||||
|
}) { |
||||||
|
return TrainInfoProvider( |
||||||
|
trainNumber: trainNumber, |
||||||
|
date: date, |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
TrainInfoProvider getProviderOverride( |
||||||
|
covariant TrainInfoProvider provider, |
||||||
|
) { |
||||||
|
return call( |
||||||
|
trainNumber: provider.trainNumber, |
||||||
|
date: provider.date, |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
static const Iterable<ProviderOrFamily>? _dependencies = null; |
||||||
|
|
||||||
|
@override |
||||||
|
Iterable<ProviderOrFamily>? get dependencies => _dependencies; |
||||||
|
|
||||||
|
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null; |
||||||
|
|
||||||
|
@override |
||||||
|
Iterable<ProviderOrFamily>? get allTransitiveDependencies => |
||||||
|
_allTransitiveDependencies; |
||||||
|
|
||||||
|
@override |
||||||
|
String? get name => r'trainInfoProvider'; |
||||||
|
} |
||||||
|
|
||||||
|
/// See also [trainInfo]. |
||||||
|
class TrainInfoProvider extends FutureProvider<TrainData> { |
||||||
|
/// See also [trainInfo]. |
||||||
|
TrainInfoProvider({ |
||||||
|
required this.trainNumber, |
||||||
|
this.date, |
||||||
|
}) : super.internal( |
||||||
|
(ref) => trainInfo( |
||||||
|
ref, |
||||||
|
trainNumber: trainNumber, |
||||||
|
date: date, |
||||||
|
), |
||||||
|
from: trainInfoProvider, |
||||||
|
name: r'trainInfoProvider', |
||||||
|
debugGetCreateSourceHash: |
||||||
|
const bool.fromEnvironment('dart.vm.product') |
||||||
|
? null |
||||||
|
: _$trainInfoHash, |
||||||
|
dependencies: TrainInfoFamily._dependencies, |
||||||
|
allTransitiveDependencies: TrainInfoFamily._allTransitiveDependencies, |
||||||
|
); |
||||||
|
|
||||||
|
final String trainNumber; |
||||||
|
final DateTime? date; |
||||||
|
|
||||||
|
@override |
||||||
|
bool operator ==(Object other) { |
||||||
|
return other is TrainInfoProvider && |
||||||
|
other.trainNumber == trainNumber && |
||||||
|
other.date == date; |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
int get hashCode { |
||||||
|
var hash = _SystemHash.combine(0, runtimeType.hashCode); |
||||||
|
hash = _SystemHash.combine(hash, trainNumber.hashCode); |
||||||
|
hash = _SystemHash.combine(hash, date.hashCode); |
||||||
|
|
||||||
|
return _SystemHash.finish(hash); |
||||||
|
} |
||||||
|
} |
||||||
|
// ignore_for_file: unnecessary_raw_strings, subtype_of_sealed_class, invalid_use_of_internal_member, do_not_use_environment, prefer_const_constructors, public_member_api_docs, avoid_private_typedef_functions |
Loading…
Reference in new issue