alarm and alarms models
This commit is contained in:
parent
548b541105
commit
1d244cccf6
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,56 +1,57 @@
|
|||
# ninja log v5
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_engine.h a79ea2499290ad1
|
||||
6516 6636 0 CMakeFiles/install.util f62cdb1652ec05e4
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_call.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/libflutter_linux_gtk.so a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_response.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h a79ea2499290ad1
|
||||
4824 6163 1715998591228440253 CMakeFiles/khazclock.dir/flutter/generated_plugin_registrant.cc.o 6c28017bd73a0433
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/build/linux/x64/debug/flutter/_phony_ a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h a79ea2499290ad1
|
||||
6248 6516 1715998591588440254 intermediates_do_not_run/khazclock 982c7a321fb6d445
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_value.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/flutter_linux.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h a79ea2499290ad1
|
||||
4823 6248 1715998591315106920 CMakeFiles/khazclock.dir/my_application.cc.o 6706c94870ab8e1d
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h a79ea2499290ad1
|
||||
36 4823 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_view.h a79ea2499290ad1
|
||||
8943 9592 1715783305930738217 CMakeFiles/khazclock.dir/main.cc.o e55002122b395a31
|
||||
36 4823 0 flutter/_phony_ a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/libflutter_linux_gtk.so a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_engine.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_call.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_response.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/libflutter_linux_gtk.so a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_call.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h a79ea2499290ad1
|
||||
5381 5501 0 CMakeFiles/install.util f62cdb1652ec05e4
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_engine.h a79ea2499290ad1
|
||||
4174 5125 1716820360325913509 CMakeFiles/khazclock.dir/flutter/generated_plugin_registrant.cc.o 6c28017bd73a0433
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/build/linux/x64/debug/flutter/_phony_ a79ea2499290ad1
|
||||
33 4173 0 flutter/_phony_ a79ea2499290ad1
|
||||
8943 9592 1715783305930738217 CMakeFiles/khazclock.dir/main.cc.o e55002122b395a31
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_view.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/flutter_linux.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h a79ea2499290ad1
|
||||
4174 5213 1716820360412580179 CMakeFiles/khazclock.dir/my_application.cc.o 6706c94870ab8e1d
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_value.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_view.h a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/flutter_linux.h a79ea2499290ad1
|
||||
33 4173 0 flutter/_phony_ a79ea2499290ad1
|
||||
33 4173 0 /sheogorath/Dev/android/flutter/khazclock/build/linux/x64/debug/flutter/_phony_ a79ea2499290ad1
|
||||
4174 5125 1716820360325913509 CMakeFiles/khazclock.dir/flutter/generated_plugin_registrant.cc.o 6c28017bd73a0433
|
||||
4174 5213 1716820360412580179 CMakeFiles/khazclock.dir/my_application.cc.o 6706c94870ab8e1d
|
||||
5213 5381 1716820360585913520 intermediates_do_not_run/khazclock 982c7a321fb6d445
|
||||
5381 5501 0 CMakeFiles/install.util f62cdb1652ec05e4
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/libflutter_linux_gtk.so a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_engine.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_call.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_method_response.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_value.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/fl_view.h a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/linux/flutter/ephemeral/flutter_linux/flutter_linux.h a79ea2499290ad1
|
||||
2 3559 0 flutter/_phony_ a79ea2499290ad1
|
||||
2 3559 0 /sheogorath/Dev/android/flutter/khazclock/build/linux/x64/debug/flutter/_phony_ a79ea2499290ad1
|
||||
3559 4187 1716897834655766600 CMakeFiles/khazclock.dir/main.cc.o e55002122b395a31
|
||||
3559 4227 1716897834695766602 CMakeFiles/khazclock.dir/flutter/generated_plugin_registrant.cc.o 6c28017bd73a0433
|
||||
3559 4261 1716897834729099937 CMakeFiles/khazclock.dir/my_application.cc.o 6706c94870ab8e1d
|
||||
4261 4414 1716897834885766609 intermediates_do_not_run/khazclock 982c7a321fb6d445
|
||||
4414 4553 0 CMakeFiles/install.util f62cdb1652ec05e4
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -6,7 +6,7 @@ void main() {
|
|||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class Alarms{
|
||||
class Alarms {
|
||||
final int user;
|
||||
final List<Alarm> alarms;
|
||||
|
||||
|
|
@ -19,17 +19,20 @@ class Alarms{
|
|||
return switch (json) {
|
||||
{
|
||||
'user': int user,
|
||||
'alarms': List<Alarm>,
|
||||
} => Alarms(
|
||||
'alarms': List<Alarm> alarms,
|
||||
} =>
|
||||
Alarms(
|
||||
user: user,
|
||||
alarms: alarms,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load alarm'),
|
||||
// TODO: Parsing fails here
|
||||
_ => throw const FormatException('Failed to load alarms'),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class Alarm {
|
||||
final int id;
|
||||
final int hour;
|
||||
final int mins;
|
||||
final bool active;
|
||||
|
|
@ -37,6 +40,7 @@ class Alarm {
|
|||
// final Days days;
|
||||
|
||||
const Alarm({
|
||||
required this.id,
|
||||
required this.hour,
|
||||
required this.mins,
|
||||
required this.active,
|
||||
|
|
@ -46,6 +50,7 @@ class Alarm {
|
|||
factory Alarm.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
'id': int id,
|
||||
'hour': int hour,
|
||||
'mins': int mins,
|
||||
'active': bool active,
|
||||
|
|
@ -61,6 +66,7 @@ class Alarm {
|
|||
// },
|
||||
} =>
|
||||
Alarm(
|
||||
id: id,
|
||||
hour: hour,
|
||||
mins: mins,
|
||||
active: active,
|
||||
|
|
@ -81,7 +87,7 @@ class Alarm {
|
|||
// }
|
||||
// }
|
||||
|
||||
Future<Alarms> fetchAlarm() async {
|
||||
Future<Alarms> fetchAlarms() async {
|
||||
final response = await http.get(Uri.parse('http://localhost:8000/'));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
|
@ -137,12 +143,12 @@ class MyHomePage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
late Future<Alarm> futureAlarm;
|
||||
late Future<Alarms> futureAlarms;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
futureAlarm = fetchAlarm();
|
||||
futureAlarms = fetchAlarms();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -150,19 +156,20 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
return Scaffold(
|
||||
body: Container(
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
child: FutureBuilder<Alarm>(
|
||||
future: futureAlarm,
|
||||
child: FutureBuilder<Alarms>(
|
||||
future: futureAlarms,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
// return Text(snapshot.data!.hour.toString());
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${snapshot.data!.hour.toString()}:${snapshot.data!.mins.toString()}")),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Repeat: ${snapshot.data!.repeat.toString()}")),
|
||||
Expanded(child: Text(
|
||||
// "${snapshot.data!.hour.toString()}:${snapshot.data!.mins.toString()}")),
|
||||
// TODO: Show data correctly
|
||||
snapshot.data!.alarms.toString())),
|
||||
// Expanded(
|
||||
// child: Text(
|
||||
// "Repeat: ${snapshot.data!.repeat.toString()}")),
|
||||
const SwitchOne(),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user