INSERTION WORKS LESGOO

This commit is contained in:
2023-12-26 22:16:19 +02:00
parent c4430ef4c5
commit f9349241f7
5 changed files with 51 additions and 68 deletions

View File

@@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:witl/arrival.dart';
Future<List<Arrival>> fetchArrivals() async {
try {
@@ -22,28 +23,3 @@ Future<List<Arrival>> fetchArrivals() async {
throw Exception('Failed to fetch data: $error');
}
}
class Arrival {
final String timeOfDay;
final int weekDay;
final int tramLine;
final bool direction;
Arrival({
required this.timeOfDay,
required this.weekDay,
required this.tramLine,
required this.direction,
});
factory Arrival.fromJson(Map<String, dynamic> json) {
return Arrival(
timeOfDay: json['time_of_day'] as String,
weekDay: json['week_day'] as int,
tramLine: json['tram_line'] as int,
direction: json['direction'] as bool,
);
}
}