Cleaned up idk
This commit is contained in:
@@ -13,6 +13,8 @@ class Arrival {
|
|||||||
|
|
||||||
factory Arrival.fromJson(Map<String, dynamic> json) {
|
factory Arrival.fromJson(Map<String, dynamic> json) {
|
||||||
return Arrival(
|
return Arrival(
|
||||||
|
// Key value
|
||||||
|
// <field>: json['<field_name_in_json>'] as <data_type>
|
||||||
// Arrival Time
|
// Arrival Time
|
||||||
timeOfDay: json['time_of_day'] as String,
|
timeOfDay: json['time_of_day'] as String,
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class _FetchAPIState extends State<FetchAPI> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text("Fetching API"),
|
title: const Text("Fetched Arrivals"),
|
||||||
actions: [
|
actions: [
|
||||||
// Refresh fetched list
|
// Refresh fetched list
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -27,9 +27,6 @@ class _FetchAPIState extends State<FetchAPI> {
|
|||||||
},
|
},
|
||||||
icon: const Icon(Icons.refresh_sharp),
|
icon: const Icon(Icons.refresh_sharp),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Spacer
|
|
||||||
const SizedBox(width: 30,),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// RefreshIndicator is used so that user can pull down
|
// RefreshIndicator is used so that user can pull down
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ class HomeScreen extends StatelessWidget {
|
|||||||
MaterialPageRoute(builder: (context) => const Settings())
|
MaterialPageRoute(builder: (context) => const Settings())
|
||||||
);},
|
);},
|
||||||
icon: const Icon(Icons.settings)),
|
icon: const Icon(Icons.settings)),
|
||||||
|
|
||||||
// Space from the end
|
|
||||||
const SizedBox(width: 30,),
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class _InputDataState extends State<InputData> {
|
|||||||
|
|
||||||
onChanged: (String? newEnd) {
|
onChanged: (String? newEnd) {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedDirection = newEnd ?? 'Victoria'; // Set a default value if newLine is null
|
selectedDirection = newEnd ?? selectedDirection; // Set a default value if newLine is null
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ class MyApp extends StatefulWidget {
|
|||||||
const MyApp({super.key});
|
const MyApp({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MyApp> createState() => _MyAppState();
|
State<MyApp> createState() => MyAppState();
|
||||||
|
|
||||||
static _MyAppState of(BuildContext context) =>
|
static MyAppState of(BuildContext context) =>
|
||||||
context.findAncestorStateOfType<_MyAppState>()!;
|
context.findAncestorStateOfType<MyAppState>()!;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MyAppState extends State<MyApp> {
|
class MyAppState extends State<MyApp> {
|
||||||
ThemeMode _theme = ThemeMode.system;
|
ThemeMode _theme = ThemeMode.system;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user