Cleaned up idk

This commit is contained in:
2024-01-04 21:45:55 +02:00
parent 6a2df6938e
commit dca0c067cb
5 changed files with 8 additions and 12 deletions

View File

@@ -13,6 +13,8 @@ class Arrival {
factory Arrival.fromJson(Map<String, dynamic> json) {
return Arrival(
// Key value
// <field>: json['<field_name_in_json>'] as <data_type>
// Arrival Time
timeOfDay: json['time_of_day'] as String,

View File

@@ -16,7 +16,7 @@ class _FetchAPIState extends State<FetchAPI> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Fetching API"),
title: const Text("Fetched Arrivals"),
actions: [
// Refresh fetched list
IconButton(
@@ -27,9 +27,6 @@ class _FetchAPIState extends State<FetchAPI> {
},
icon: const Icon(Icons.refresh_sharp),
),
// Spacer
const SizedBox(width: 30,),
],
),
// RefreshIndicator is used so that user can pull down

View File

@@ -36,9 +36,6 @@ class HomeScreen extends StatelessWidget {
MaterialPageRoute(builder: (context) => const Settings())
);},
icon: const Icon(Icons.settings)),
// Space from the end
const SizedBox(width: 30,),
]
),
),

View File

@@ -117,7 +117,7 @@ class _InputDataState extends State<InputData> {
onChanged: (String? newEnd) {
setState(() {
selectedDirection = newEnd ?? 'Victoria'; // Set a default value if newLine is null
selectedDirection = newEnd ?? selectedDirection; // Set a default value if newLine is null
});
},
),

View File

@@ -10,13 +10,13 @@ class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
State<MyApp> createState() => MyAppState();
static _MyAppState of(BuildContext context) =>
context.findAncestorStateOfType<_MyAppState>()!;
static MyAppState of(BuildContext context) =>
context.findAncestorStateOfType<MyAppState>()!;
}
class _MyAppState extends State<MyApp> {
class MyAppState extends State<MyApp> {
ThemeMode _theme = ThemeMode.system;
@override