Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 48e80b56bf | |||
| a84c68b01e |
@@ -1,9 +1,9 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<application
|
<application
|
||||||
android:label="WITL"
|
android:label="witl"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/launcher_icon">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 868 B After Width: | Height: | Size: 295 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 406 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 450 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 282 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 462 B |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 704 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 406 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 586 B |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 862 B |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 862 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 762 B |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -5,7 +5,7 @@
|
|||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>WITL</string>
|
<string>Witl</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>WITL</string>
|
<string>witl</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:witl/main.dart';
|
|
||||||
|
|
||||||
class Settings extends StatefulWidget {
|
|
||||||
const Settings({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<Settings> createState() => _Settings();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _Settings extends State<Settings> {
|
|
||||||
late String selectedTheme = 'System Default'; // Default app theme
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: const Text("Settings"),
|
|
||||||
),
|
|
||||||
|
|
||||||
body: ListView(
|
|
||||||
children:[
|
|
||||||
// List of Tiles in the Settings Screen
|
|
||||||
// Starting with App Theme
|
|
||||||
ListTile(
|
|
||||||
title: const Text("App Theme"),
|
|
||||||
subtitle: const Text("Sets the theme of the app between: Dark, Light, System Default."),
|
|
||||||
// User Selection
|
|
||||||
trailing: DropdownButton<String> (
|
|
||||||
value: selectedTheme,
|
|
||||||
items: <String>["Light", "Dark", "System Default"].map((String value) {
|
|
||||||
return DropdownMenuItem<String>(
|
|
||||||
value: value,
|
|
||||||
child: Text(value),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
// Updating Selection
|
|
||||||
onChanged: (String? updatedTheme) {
|
|
||||||
setState(() {
|
|
||||||
selectedTheme = updatedTheme ?? selectedTheme;
|
|
||||||
MyApp.of(context).changeTheme(selectedTheme);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,18 +13,9 @@ 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
|
|
||||||
timeOfDay: json['time_of_day'] as String,
|
timeOfDay: json['time_of_day'] as String,
|
||||||
|
|
||||||
// Day 1 -> 7 !! Starting from Monday !!
|
|
||||||
weekDay: json['week_day'] as int,
|
weekDay: json['week_day'] as int,
|
||||||
|
|
||||||
// Line 1 or 2
|
|
||||||
tramLine: json['tram_line'] as int,
|
tramLine: json['tram_line'] as int,
|
||||||
|
|
||||||
// True -> Raml, False -> Victoria
|
|
||||||
direction: json['direction'] as bool,
|
direction: json['direction'] as bool,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,16 +6,18 @@ import 'package:witl/arrival.dart';
|
|||||||
|
|
||||||
Future<List<Arrival>> fetchArrivals() async {
|
Future<List<Arrival>> fetchArrivals() async {
|
||||||
try {
|
try {
|
||||||
// Grabbing http reponse
|
|
||||||
final response = await http.get(Uri.parse('http://141.144.238.26:48502/arrivals/all'));
|
final response = await http.get(Uri.parse('http://141.144.238.26:48502/arrivals/all'));
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
// Some JSON fuckery xd
|
// List<dynamic> data = jsonDecode(response.body);
|
||||||
|
// List<Arrival> arrivals = List<Arrival>.from(data.map((dynamic arrivalJson) {
|
||||||
|
// return Arrival.fromJson(arrivalJson);
|
||||||
|
// }));
|
||||||
Iterable I = json.decode(response.body);
|
Iterable I = json.decode(response.body);
|
||||||
List<Arrival> arrivals = List<Arrival>.from(I.map((model)=>Arrival.fromJson(model)));
|
List<Arrival> arrivals = List<Arrival>.from(I.map((model)=>Arrival.fromJson(model)));
|
||||||
return arrivals.reversed.toList();
|
return arrivals.reversed.toList();
|
||||||
} else {
|
} else {
|
||||||
throw Exception('Failed to load Arrivals list');
|
throw Exception('Failed to load Arrival');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw Exception('Failed to fetch data: $error');
|
throw Exception('Failed to fetch data: $error');
|
||||||
|
|||||||
@@ -4,33 +4,22 @@ import 'package:http/http.dart' as http;
|
|||||||
import 'package:witl/arrival.dart';
|
import 'package:witl/arrival.dart';
|
||||||
|
|
||||||
Future<Arrival> insertArrival(String date, int weekday, int line, bool direction) async {
|
Future<Arrival> insertArrival(String date, int weekday, int line, bool direction) async {
|
||||||
final client = http.Client();
|
final response = await http.post(
|
||||||
|
Uri.parse('http://141.144.238.26:48502/arrivals/insert'),
|
||||||
|
headers: <String, String> {
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
},
|
||||||
|
body: jsonEncode(<String, dynamic> {
|
||||||
|
'time_of_day': date,
|
||||||
|
'week_day': weekday,
|
||||||
|
'tram_line': line,
|
||||||
|
'direction': direction,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
if (response.statusCode == 201) {
|
||||||
// POST response as JSON
|
return Arrival.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
|
||||||
final response = await client.post(
|
} else {
|
||||||
Uri.parse('http://141.144.238.26:48502/arrivals/insert'),
|
throw Exception('Insertion Failure.');
|
||||||
headers: <String, String> {
|
|
||||||
// Headers used
|
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
|
||||||
},
|
|
||||||
// Encoding a singular json entry
|
|
||||||
body: jsonEncode(<String, dynamic> {
|
|
||||||
'time_of_day': date,
|
|
||||||
'week_day': weekday,
|
|
||||||
'tram_line': line,
|
|
||||||
'direction': direction,
|
|
||||||
})
|
|
||||||
).timeout(const Duration(seconds: 10));
|
|
||||||
|
|
||||||
if (response.statusCode == 201) {
|
|
||||||
return Arrival.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
|
|
||||||
} else {
|
|
||||||
throw Exception('Insertion Failure.');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
throw Exception("Error Posting: $error");
|
|
||||||
} finally {
|
|
||||||
client.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,9 +16,8 @@ class _FetchAPIState extends State<FetchAPI> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text("Fetched Arrivals"),
|
title: const Text("Fetching API"),
|
||||||
actions: [
|
actions: [
|
||||||
// Refresh fetched list
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -27,12 +26,10 @@ class _FetchAPIState extends State<FetchAPI> {
|
|||||||
},
|
},
|
||||||
icon: const Icon(Icons.refresh_sharp),
|
icon: const Icon(Icons.refresh_sharp),
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 30,),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// RefreshIndicator is used so that user can pull down
|
|
||||||
// in order to update instead of pressing the refresh button
|
|
||||||
body: RefreshIndicator(
|
body: RefreshIndicator(
|
||||||
// Method to Use no argument parenthesis
|
|
||||||
onRefresh: _refreshData,
|
onRefresh: _refreshData,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
@@ -43,40 +40,17 @@ class _FetchAPIState extends State<FetchAPI> {
|
|||||||
future: fetchedArrivals,
|
future: fetchedArrivals,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
return Center(
|
return const CircularProgressIndicator();
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: MediaQuery. of(context). size. height / 2,
|
|
||||||
width: MediaQuery. of(context). size. width / 3,
|
|
||||||
|
|
||||||
child: const CircularProgressIndicator(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else if (snapshot.hasError) {
|
} else if (snapshot.hasError) {
|
||||||
return Text('Failed to fetch data.\nError: ${snapshot.error}');
|
return Text('Failed to fetch data.\nError: ${snapshot.error}');
|
||||||
} else {
|
} else {
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
// List items to display
|
|
||||||
itemCount: snapshot.data!.length,
|
itemCount: snapshot.data!.length,
|
||||||
// Building them
|
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
// Really should be more informative about what's displayed
|
|
||||||
title: Text("Arrival Time: ${snapshot.data![index].timeOfDay}"),
|
title: Text("Arrival Time: ${snapshot.data![index].timeOfDay}"),
|
||||||
titleAlignment: ListTileTitleAlignment.center,
|
titleAlignment: ListTileTitleAlignment.center,
|
||||||
subtitle: Text("Week Day: ${weekNumToString(snapshot.data![index].weekDay)}"),
|
subtitle: Text("Week Day: ${weekNumToString(snapshot.data![index].weekDay)}"),
|
||||||
onTap: () => {
|
|
||||||
showArrivalInfo(context, snapshot.data![index])
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -85,16 +59,10 @@ class _FetchAPIState extends State<FetchAPI> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 30,),
|
const SizedBox(height: 30,),
|
||||||
|
|
||||||
InkWell(
|
InkWell(
|
||||||
// Navigating Home
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamedAndRemoveUntil(
|
Navigator.pushNamedAndRemoveUntil(context, '/', (route) => false);
|
||||||
context,
|
|
||||||
'/home',
|
|
||||||
(route) => false);
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
@@ -110,7 +78,6 @@ class _FetchAPIState extends State<FetchAPI> {
|
|||||||
|
|
||||||
Future<void> _refreshData() async {
|
Future<void> _refreshData() async {
|
||||||
setState(() {
|
setState(() {
|
||||||
// Refresh arrivals list by invoking the fetch method
|
|
||||||
fetchedArrivals = fetchArrivals();
|
fetchedArrivals = fetchArrivals();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -122,33 +89,6 @@ class _FetchAPIState extends State<FetchAPI> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showArrivalInfo(BuildContext context, Arrival data) {
|
|
||||||
// set up the button
|
|
||||||
Widget okButton = TextButton(
|
|
||||||
child: const Text("Back"),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// set up the AlertDialog
|
|
||||||
AlertDialog alert = AlertDialog(
|
|
||||||
title: const Text("Selected Arrival Info"),
|
|
||||||
content: Text("Tram Colour: JSON DOESN'T HAVE COLOUR\n\nChosen Line: ${lineShift(data.tramLine)}\n\nDirection: ${directionParse(data.direction)}\n\nSubmitted On: ${data.timeOfDay} (Needs to include date)"),
|
|
||||||
actions: [
|
|
||||||
okButton,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
// show the dialogue
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return alert;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
String weekNumToString(int weekday) {
|
String weekNumToString(int weekday) {
|
||||||
switch (weekday) {
|
switch (weekday) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -167,25 +107,5 @@ String weekNumToString(int weekday) {
|
|||||||
return "Sunday";
|
return "Sunday";
|
||||||
}
|
}
|
||||||
|
|
||||||
throw "Week Day Parse Error";
|
throw "AAAAAAAAA";
|
||||||
}
|
|
||||||
|
|
||||||
String directionParse(bool direction) {
|
|
||||||
switch (direction) {
|
|
||||||
case true:
|
|
||||||
return "Raml";
|
|
||||||
case false:
|
|
||||||
return "Victoria";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int lineShift(int line) {
|
|
||||||
switch (line) {
|
|
||||||
case 3:
|
|
||||||
return 1;
|
|
||||||
case 4:
|
|
||||||
return 2;
|
|
||||||
default:
|
|
||||||
return line;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:witl/fetcher.dart';
|
import 'package:witl/fetcher.dart';
|
||||||
import 'package:witl/input_data.dart';
|
import 'package:witl/input_data.dart';
|
||||||
import 'package:witl/app_settings.dart';
|
|
||||||
|
|
||||||
class HomeScreen extends StatelessWidget {
|
class HomeScreen extends StatelessWidget {
|
||||||
const HomeScreen({super.key});
|
const HomeScreen({super.key});
|
||||||
@@ -13,44 +12,12 @@ class HomeScreen extends StatelessWidget {
|
|||||||
title: Row(
|
title: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
// Hamburbur menu
|
Image.asset('assets/images/choo.png',
|
||||||
IconButton(
|
fit: BoxFit.contain,
|
||||||
onPressed: () {
|
height: 64,
|
||||||
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.menu_sharp)
|
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 10,),
|
||||||
// Space
|
|
||||||
// const SizedBox(width: 30,),
|
|
||||||
|
|
||||||
// Our Amazing Logo
|
|
||||||
// Image.asset('assets/images/choo.png',
|
|
||||||
// fit: BoxFit.contain,
|
|
||||||
// height: 64,
|
|
||||||
// ),
|
|
||||||
|
|
||||||
// Spacing
|
|
||||||
// const SizedBox(width: 10,),
|
|
||||||
|
|
||||||
const Expanded(child: SizedBox()),
|
|
||||||
|
|
||||||
// App Title
|
|
||||||
const Text("WITL"),
|
const Text("WITL"),
|
||||||
|
|
||||||
// Fill out the area blankly
|
|
||||||
// So that the icon can be shoved far right
|
|
||||||
const Expanded(child: SizedBox(),),
|
|
||||||
|
|
||||||
// Navigate to Settings
|
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => const Settings())
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.settings)),
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -60,15 +27,12 @@ class HomeScreen extends StatelessWidget {
|
|||||||
const Row(
|
const Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children:[
|
children:[
|
||||||
// Our Motto (?)
|
|
||||||
Text("We may not be able to tell you why.\nBut surely are able to predict when."),
|
Text("We may not be able to tell you why.\nBut surely are able to predict when."),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
// Spacing
|
|
||||||
const SizedBox(height: 80),
|
const SizedBox(height: 80),
|
||||||
|
|
||||||
// To the fetching screen
|
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap:() {
|
onTap:() {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
@@ -84,7 +48,6 @@ class HomeScreen extends StatelessWidget {
|
|||||||
|
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
|
|
||||||
// To Data Input
|
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap:() {
|
onTap:() {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ class _InputDataState extends State<InputData> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
// Naming the screen
|
title: const Text("Data Input"),
|
||||||
title: const Text("Arrivals Input"),
|
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@@ -34,53 +33,42 @@ class _InputDataState extends State<InputData> {
|
|||||||
|
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
|
|
||||||
// Prompt Row
|
|
||||||
const Row(
|
const Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text("Line:"),
|
Text("Line:"),
|
||||||
|
|
||||||
SizedBox(width: 35),
|
SizedBox(width: 35),
|
||||||
|
|
||||||
Text("Colour:"),
|
Text("Colour:"),
|
||||||
|
|
||||||
SizedBox(width: 25),
|
SizedBox(width: 25),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
// Checkbox Row
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
DropdownButton<int>(
|
DropdownButton<int>(
|
||||||
value: selectedLine,
|
value: selectedLine,
|
||||||
|
|
||||||
items: <int>[1, 2].map((int value) {
|
items: <int>[1, 2].map((int value) {
|
||||||
return DropdownMenuItem<int>(
|
return DropdownMenuItem<int>(
|
||||||
value: value,
|
value: value,
|
||||||
child: Text(value.toString()),
|
child: Text(value.toString()),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
|
||||||
onChanged: (int? newLine) {
|
onChanged: (int? newLine) {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedLine = newLine ?? 1; // Set a default value if newLine is null
|
selectedLine = newLine ?? 1; // Set a default value if newLine is null
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(width: 30),
|
const SizedBox(width: 30),
|
||||||
|
|
||||||
DropdownButton<String>(
|
DropdownButton<String>(
|
||||||
value: selectedColor,
|
value: selectedColor,
|
||||||
|
|
||||||
items: <String>['Blue', 'Yellow'].map((String value) {
|
items: <String>['Blue', 'Yellow'].map((String value) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: value,
|
value: value,
|
||||||
child: Text(value),
|
child: Text(value),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
|
||||||
onChanged: (String? newCol) {
|
onChanged: (String? newCol) {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedColor = newCol ?? 'Blue'; // Set a default value if newCol is null
|
selectedColor = newCol ?? 'Blue'; // Set a default value if newCol is null
|
||||||
@@ -94,7 +82,6 @@ class _InputDataState extends State<InputData> {
|
|||||||
|
|
||||||
const Row(
|
const Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
Text("Direction:"),
|
Text("Direction:"),
|
||||||
SizedBox(width: 20),
|
SizedBox(width: 20),
|
||||||
@@ -103,21 +90,18 @@ class _InputDataState extends State<InputData> {
|
|||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
DropdownButton<String>(
|
DropdownButton<String>(
|
||||||
value: selectedDirection,
|
value: selectedDirection,
|
||||||
|
|
||||||
items: <String>['Raml', 'Victoria'].map((String value) {
|
items: <String>['Raml', 'Victoria'].map((String value) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: value,
|
value: value,
|
||||||
child: Text(value),
|
child: Text(value),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
|
||||||
onChanged: (String? newEnd) {
|
onChanged: (String? newEnd) {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedDirection = newEnd ?? selectedDirection; // Set a default value if newLine is null
|
selectedDirection = newEnd ?? 'Victoria'; // Set a default value if newLine is null
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -127,10 +111,6 @@ class _InputDataState extends State<InputData> {
|
|||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
|
|
||||||
InkWell(
|
InkWell(
|
||||||
hoverDuration: const Duration(milliseconds: 450),
|
|
||||||
hoverColor: (selectedColor == "Blue") ? Colors.blue[500] : Colors.yellow[700],
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
|
||||||
splashColor: (selectedColor == "Blue") ? Colors.blue[800] : Colors.yellow[700],
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Grab Data from Dropdowns
|
// Grab Data from Dropdowns
|
||||||
selectedColor; //
|
selectedColor; //
|
||||||
@@ -159,9 +139,8 @@ class _InputDataState extends State<InputData> {
|
|||||||
insertArrival('${now.hour}:${now.minute}:${now.second}', now.weekday, selectedLine, payloadDirection);
|
insertArrival('${now.hour}:${now.minute}:${now.second}', now.weekday, selectedLine, payloadDirection);
|
||||||
|
|
||||||
//prompting of submission
|
//prompting of submission
|
||||||
showSubmissionSuccess(context, selectedLine, selectedColor, selectedDirection, userFormattedString);
|
showAlertDialog(context, selectedLine, selectedColor, selectedDirection, userFormattedString);
|
||||||
},
|
},
|
||||||
|
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: const Text("Submit Arrival"),
|
child: const Text("Submit Arrival"),
|
||||||
@@ -178,7 +157,6 @@ class _InputDataState extends State<InputData> {
|
|||||||
(route) => false
|
(route) => false
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: const Text("Homescreen")),
|
child: const Text("Homescreen")),
|
||||||
@@ -194,7 +172,6 @@ class _InputDataState extends State<InputData> {
|
|||||||
(route) => false
|
(route) => false
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: const Text("Fetch Data")),
|
child: const Text("Fetch Data")),
|
||||||
@@ -205,10 +182,7 @@ class _InputDataState extends State<InputData> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showSubmissionSuccess(BuildContext context, int chosenLine, String chosenColour, String chosenDir, String submissionDate) {
|
showAlertDialog(BuildContext context, int chosenLine, String chosenColour, String chosenDir, String submissionDate) {
|
||||||
|
|
||||||
// Delay (I want the splash to show)
|
|
||||||
//Future.delayed(const Duration(milliseconds: 200));
|
|
||||||
|
|
||||||
// set up the button
|
// set up the button
|
||||||
Widget okButton = TextButton(
|
Widget okButton = TextButton(
|
||||||
@@ -216,7 +190,7 @@ showSubmissionSuccess(BuildContext context, int chosenLine, String chosenColour,
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamedAndRemoveUntil(
|
Navigator.pushNamedAndRemoveUntil(
|
||||||
context,
|
context,
|
||||||
'/home',
|
'/',
|
||||||
(route) => false);
|
(route) => false);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,86 +1,39 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:witl/app_settings.dart';
|
|
||||||
import 'package:witl/fetcher.dart';
|
import 'package:witl/fetcher.dart';
|
||||||
import 'package:witl/home_screen.dart';
|
import 'package:witl/home_screen.dart';
|
||||||
import 'package:witl/input_data.dart';
|
import 'package:witl/input_data.dart';
|
||||||
|
|
||||||
void main() => runApp(const MyApp());
|
void main() => runApp(const MyApp());
|
||||||
|
|
||||||
class MyApp extends StatefulWidget {
|
class MyApp extends StatelessWidget {
|
||||||
const MyApp({super.key});
|
const MyApp({super.key});
|
||||||
|
|
||||||
@override
|
|
||||||
State<MyApp> createState() => MyAppState();
|
|
||||||
|
|
||||||
static MyAppState of(BuildContext context) =>
|
|
||||||
context.findAncestorStateOfType<MyAppState>()!;
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyAppState extends State<MyApp> {
|
|
||||||
ThemeMode _theme = ThemeMode.system;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: "WITL App",
|
title: "Entry Point",
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
primaryColor: Colors.white,
|
appBarTheme: AppBarTheme(
|
||||||
brightness: Brightness.light,
|
color: Colors.amber[100],
|
||||||
dividerColor: Colors.white54,
|
),
|
||||||
scaffoldBackgroundColor: Colors.white,
|
|
||||||
),
|
),
|
||||||
|
|
||||||
darkTheme: ThemeData(
|
|
||||||
primarySwatch: Colors.blue,
|
|
||||||
primaryColor: Colors.black,
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
dividerColor: Colors.white38,
|
|
||||||
scaffoldBackgroundColor: const Color(0xFF131313),
|
|
||||||
),
|
|
||||||
|
|
||||||
themeMode: _theme,
|
|
||||||
|
|
||||||
// Navigashun with Routes
|
// Navigashun with Routes
|
||||||
// Base "Home" Route
|
// Base "Home" Route
|
||||||
initialRoute: '/home',
|
initialRoute: '/',
|
||||||
|
|
||||||
// Possible Routes
|
// Possible Routes
|
||||||
routes: {
|
routes: {
|
||||||
// Login (Eventually)
|
|
||||||
//'/login': (context) => const LogIn(),
|
|
||||||
|
|
||||||
// Signup (Also eventually xd)
|
|
||||||
//'/login/signup': (context) => const SignUp(),
|
|
||||||
|
|
||||||
// Homescreen
|
// Homescreen
|
||||||
'/home': (context) => const HomeScreen(),
|
'/': (context) => const HomeScreen(),
|
||||||
|
|
||||||
// Fetching API Data
|
// Fetching API Data
|
||||||
'/fetch': (context) => const FetchAPI(),
|
'/fetch': (context) => const FetchAPI(),
|
||||||
|
|
||||||
// User Input
|
// User Input
|
||||||
'/input': (context) => const InputData(),
|
'/input': (context) => const InputData(),
|
||||||
|
|
||||||
// Settings
|
|
||||||
'/settings': (context) => const Settings(),
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeTheme(String newTheme) {
|
|
||||||
setState(() {
|
|
||||||
switch(newTheme) {
|
|
||||||
case "Light":
|
|
||||||
_theme = ThemeMode.light;
|
|
||||||
break;
|
|
||||||
case "Dark":
|
|
||||||
_theme = ThemeMode.dark;
|
|
||||||
break;
|
|
||||||
case "System Default":
|
|
||||||
_theme = ThemeMode.system;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
22
lib/stations.dart
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
class TramStation {
|
||||||
|
final String name;
|
||||||
|
final String city;
|
||||||
|
final double latitude;
|
||||||
|
final double longitude;
|
||||||
|
|
||||||
|
TramStation({
|
||||||
|
required this.name,
|
||||||
|
required this.city,
|
||||||
|
required this.latitude,
|
||||||
|
required this.longitude,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory TramStation.fromJson(Map<String, dynamic> json) {
|
||||||
|
return TramStation(
|
||||||
|
name: json['name'] as String,
|
||||||
|
city: json['city'] as String,
|
||||||
|
latitude: json['latitude'] as double,
|
||||||
|
longitude: json['longitude'] as double,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ project(runner LANGUAGES CXX)
|
|||||||
|
|
||||||
# The name of the executable created for the application. Change this to change
|
# The name of the executable created for the application. Change this to change
|
||||||
# the on-disk name of your application.
|
# the on-disk name of your application.
|
||||||
set(BINARY_NAME "WITL")
|
set(BINARY_NAME "witl")
|
||||||
# The unique GTK application identifier for this application. See:
|
# The unique GTK application identifier for this application. See:
|
||||||
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
||||||
set(APPLICATION_ID "com.example.witl")
|
set(APPLICATION_ID "com.example.witl")
|
||||||
|
|||||||
@@ -1,68 +1,68 @@
|
|||||||
{
|
{
|
||||||
"info": {
|
"images" : [
|
||||||
"version": 1,
|
{
|
||||||
"author": "xcode"
|
"size" : "16x16",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"filename" : "app_icon_16.png",
|
||||||
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
"images": [
|
{
|
||||||
{
|
"size" : "16x16",
|
||||||
"size": "16x16",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_32.png",
|
||||||
"filename": "app_icon_16.png",
|
"scale" : "2x"
|
||||||
"scale": "1x"
|
},
|
||||||
},
|
{
|
||||||
{
|
"size" : "32x32",
|
||||||
"size": "16x16",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_32.png",
|
||||||
"filename": "app_icon_32.png",
|
"scale" : "1x"
|
||||||
"scale": "2x"
|
},
|
||||||
},
|
{
|
||||||
{
|
"size" : "32x32",
|
||||||
"size": "32x32",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_64.png",
|
||||||
"filename": "app_icon_32.png",
|
"scale" : "2x"
|
||||||
"scale": "1x"
|
},
|
||||||
},
|
{
|
||||||
{
|
"size" : "128x128",
|
||||||
"size": "32x32",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_128.png",
|
||||||
"filename": "app_icon_64.png",
|
"scale" : "1x"
|
||||||
"scale": "2x"
|
},
|
||||||
},
|
{
|
||||||
{
|
"size" : "128x128",
|
||||||
"size": "128x128",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_256.png",
|
||||||
"filename": "app_icon_128.png",
|
"scale" : "2x"
|
||||||
"scale": "1x"
|
},
|
||||||
},
|
{
|
||||||
{
|
"size" : "256x256",
|
||||||
"size": "128x128",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_256.png",
|
||||||
"filename": "app_icon_256.png",
|
"scale" : "1x"
|
||||||
"scale": "2x"
|
},
|
||||||
},
|
{
|
||||||
{
|
"size" : "256x256",
|
||||||
"size": "256x256",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_512.png",
|
||||||
"filename": "app_icon_256.png",
|
"scale" : "2x"
|
||||||
"scale": "1x"
|
},
|
||||||
},
|
{
|
||||||
{
|
"size" : "512x512",
|
||||||
"size": "256x256",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_512.png",
|
||||||
"filename": "app_icon_512.png",
|
"scale" : "1x"
|
||||||
"scale": "2x"
|
},
|
||||||
},
|
{
|
||||||
{
|
"size" : "512x512",
|
||||||
"size": "512x512",
|
"idiom" : "mac",
|
||||||
"idiom": "mac",
|
"filename" : "app_icon_1024.png",
|
||||||
"filename": "app_icon_512.png",
|
"scale" : "2x"
|
||||||
"scale": "1x"
|
}
|
||||||
},
|
],
|
||||||
{
|
"info" : {
|
||||||
"size": "512x512",
|
"version" : 1,
|
||||||
"idiom": "mac",
|
"author" : "xcode"
|
||||||
"filename": "app_icon_1024.png",
|
}
|
||||||
"scale": "2x"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 520 B |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -5,7 +5,7 @@
|
|||||||
// 'flutter create' template.
|
// 'flutter create' template.
|
||||||
|
|
||||||
// The application's name. By default this is also the title of the Flutter window.
|
// The application's name. By default this is also the title of the Flutter window.
|
||||||
PRODUCT_NAME = WITL
|
PRODUCT_NAME = witl
|
||||||
|
|
||||||
// The application's bundle identifier
|
// The application's bundle identifier
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.witl
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.witl
|
||||||
|
|||||||
32
pubspec.lock
@@ -41,22 +41,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
checked_yaml:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: checked_yaml
|
|
||||||
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.3"
|
|
||||||
cli_util:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: cli_util
|
|
||||||
sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.4.1"
|
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -114,10 +98,10 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_launcher_icons
|
name: flutter_launcher_icons
|
||||||
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
|
sha256: "559c600f056e7c704bd843723c21e01b5fba47e8824bd02422165bcc02a5de1d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.13.1"
|
version: "0.9.3"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -151,10 +135,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271"
|
sha256: "8e9d133755c3e84c73288363e6343157c383a0c6c56fc51afcc5d4d7180306d6"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.3"
|
version: "3.3.0"
|
||||||
intl:
|
intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -171,14 +155,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.7"
|
version: "0.6.7"
|
||||||
json_annotation:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: json_annotation
|
|
||||||
sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "4.8.1"
|
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
21
pubspec.yaml
@@ -42,7 +42,7 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
flutter_launcher_icons: ^0.13.1
|
flutter_launcher_icons: "^0.9.3"
|
||||||
|
|
||||||
# The "flutter_lints" package below contains a set of recommended lints to
|
# The "flutter_lints" package below contains a set of recommended lints to
|
||||||
# encourage good coding practices. The lint set provided by the package is
|
# encourage good coding practices. The lint set provided by the package is
|
||||||
@@ -51,23 +51,10 @@ dev_dependencies:
|
|||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
flutter_lints: ^3.0.1
|
flutter_lints: ^3.0.1
|
||||||
|
|
||||||
flutter_launcher_icons:
|
flutter_icons:
|
||||||
android: "launcher_icon"
|
|
||||||
ios: true
|
|
||||||
image_path: "assets/images/choo.png"
|
image_path: "assets/images/choo.png"
|
||||||
min_sdk_android: 21 # android min sdk min:16, default 21
|
android: true
|
||||||
web:
|
ios: true
|
||||||
generate: true
|
|
||||||
image_path: "assets/images/choo.png"
|
|
||||||
background_color: "#FFFFFF"
|
|
||||||
theme_color: "#FFFFFF"
|
|
||||||
windows:
|
|
||||||
generate: true
|
|
||||||
image_path: "assets/images/choo.png"
|
|
||||||
icon_size: 48 # min:48, max:256, default: 48
|
|
||||||
macos:
|
|
||||||
generate: true
|
|
||||||
image_path: "assets/images/choo.png"
|
|
||||||
|
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
|
|||||||
BIN
web/favicon.png
|
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 917 B |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 20 KiB |
@@ -29,7 +29,7 @@
|
|||||||
<!-- Favicon -->
|
<!-- Favicon -->
|
||||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||||
|
|
||||||
<title>WITL</title>
|
<title>witl</title>
|
||||||
<link rel="manifest" href="manifest.json">
|
<link rel="manifest" href="manifest.json">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
"short_name": "witl",
|
"short_name": "witl",
|
||||||
"start_url": ".",
|
"start_url": ".",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"background_color": "#FFFFFF",
|
"background_color": "#0175C2",
|
||||||
"theme_color": "#FFFFFF",
|
"theme_color": "#0175C2",
|
||||||
"description": "A new Flutter project.",
|
"description": "A new Flutter project.",
|
||||||
"orientation": "portrait-primary",
|
"orientation": "portrait-primary",
|
||||||
"prefer_related_applications": false,
|
"prefer_related_applications": false,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
|||||||
FlutterWindow window(project);
|
FlutterWindow window(project);
|
||||||
Win32Window::Point origin(10, 10);
|
Win32Window::Point origin(10, 10);
|
||||||
Win32Window::Size size(1280, 720);
|
Win32Window::Size size(1280, 720);
|
||||||
if (!window.Create(L"WITL", origin, size)) {
|
if (!window.Create(L"witl", origin, size)) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
window.SetQuitOnClose(true);
|
window.SetQuitOnClose(true);
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 33 KiB |