==0.7.5-nightly 2021-11-16==
- added strapi connector - cleanup code - updated readme - TODO: - update license & copyright info - cleanup code - merge code parts to server side - complete settings - fix 11/12 - add caching - muuuuuuuch more...
This commit is contained in:
parent
11b8435734
commit
223414559e
@ -4,8 +4,6 @@ import 'package:flutter/material.dart';
|
|||||||
class AppearanceSettings extends StatelessWidget {
|
class AppearanceSettings extends StatelessWidget {
|
||||||
const AppearanceSettings({Key? key}) : super(key: key);
|
const AppearanceSettings({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -15,9 +13,7 @@ class AppearanceSettings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
||||||
children: [
|
children: [],
|
||||||
|
|
||||||
],
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,16 +27,16 @@ class DevSettings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
onSubmitted: (String value) async {
|
onSubmitted: (String value) async {
|
||||||
SharedPreferences prefs =
|
SharedPreferences prefs =
|
||||||
await SharedPreferences.getInstance();
|
await SharedPreferences.getInstance();
|
||||||
String apiKey = value;
|
String apiKey = value;
|
||||||
await prefs.setString('api_key', apiKey);
|
await prefs.setString('api_key', apiKey);
|
||||||
final snackBar = SnackBar(
|
final snackBar = SnackBar(
|
||||||
content: Text('Neuer API-Schlüssel gesetzt: $apiKey'));
|
content:
|
||||||
|
Text('Neuer API-Schlüssel gesetzt: $apiKey'));
|
||||||
|
|
||||||
// Find the ScaffoldMessenger in the widget tree
|
// Find the ScaffoldMessenger in the widget tree
|
||||||
// and use it to show a SnackBar.
|
// and use it to show a SnackBar.
|
||||||
ScaffoldMessenger.of(context)
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
.showSnackBar(snackBar);
|
|
||||||
})),
|
})),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
Padding(
|
Padding(
|
||||||
@ -49,9 +49,8 @@ class DevSettings extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: const Text("Benutzerdaten neu laden"),
|
child: const Text("Benutzerdaten neu laden"),
|
||||||
)
|
))
|
||||||
)
|
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,6 @@ import 'package:MeinCantor/const.dart';
|
|||||||
class InfoSettings extends StatelessWidget {
|
class InfoSettings extends StatelessWidget {
|
||||||
const InfoSettings({Key? key}) : super(key: key);
|
const InfoSettings({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -18,10 +16,9 @@ class InfoSettings extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
||||||
children: [
|
children: [
|
||||||
const ListTile(
|
const ListTile(
|
||||||
leading: Icon(Icons.info_outlined),
|
leading: Icon(Icons.info_outlined),
|
||||||
title: Text("Version"),
|
title: Text("Version"),
|
||||||
subtitle: Text(version)
|
subtitle: Text(version)),
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.settings_backup_restore_outlined),
|
leading: const Icon(Icons.settings_backup_restore_outlined),
|
||||||
title: const Text("Änderungsverlauf"),
|
title: const Text("Änderungsverlauf"),
|
||||||
@ -34,42 +31,45 @@ class InfoSettings extends StatelessWidget {
|
|||||||
height: 400,
|
height: 400,
|
||||||
//color: Colors.amber,
|
//color: Colors.amber,
|
||||||
child: Column(
|
child: Column(
|
||||||
//mainAxisAlignment: MainAxisAlignment.center,
|
//mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
AppBar(
|
AppBar(
|
||||||
title: const Text("Änderungsverlauf"),
|
title: const Text("Änderungsverlauf"),
|
||||||
),
|
),
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.all(10),
|
padding: EdgeInsets.all(10),
|
||||||
child: Text(""),
|
child: Text(""),
|
||||||
),
|
),
|
||||||
/*ElevatedButton(
|
/*ElevatedButton(
|
||||||
child: const Text('Close BottomSheet'),
|
child: const Text('Close BottomSheet'),
|
||||||
onPressed: () => Navigator.pop(context),
|
onPressed: () => Navigator.pop(context),
|
||||||
)*/
|
)*/
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.copyright_outlined),
|
leading: const Icon(Icons.copyright_outlined),
|
||||||
title: const Text("Lizenzen"),
|
title: const Text("Lizenzen"),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => LicensePage(
|
MaterialPageRoute(
|
||||||
applicationIcon: Image.asset("assets/images/meincantor_r.png",
|
builder: (context) => LicensePage(
|
||||||
height: 64, width: 64),
|
applicationIcon: Image.asset(
|
||||||
applicationVersion: version,
|
"assets/images/meincantor_r.png",
|
||||||
)),
|
height: 64,
|
||||||
);
|
width: 64),
|
||||||
},
|
applicationVersion: version,
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@ import 'package:cyclop/cyclop.dart';
|
|||||||
import 'package:MeinCantor/networking.dart';
|
import 'package:MeinCantor/networking.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import '../../color_presets.dart';
|
import 'package:MeinCantor/presets/colors.dart';
|
||||||
import 'package:MeinCantor/subject_presets.dart';
|
import 'package:MeinCantor/presets/subjects.dart';
|
||||||
|
|
||||||
import '../../teacher_presets.dart';
|
import 'package:MeinCantor/presets/teachers.dart';
|
||||||
|
|
||||||
class PlanSettings extends StatefulWidget {
|
class PlanSettings extends StatefulWidget {
|
||||||
const PlanSettings({Key? key}) : super(key: key);
|
const PlanSettings({Key? key}) : super(key: key);
|
||||||
@ -39,7 +39,12 @@ Future<List<dynamic>> buildLessonsList() async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _PlanSettingsState extends State<PlanSettings> {
|
class _PlanSettingsState extends State<PlanSettings> {
|
||||||
Set<Color> swatches = {...Colors.primaries, ...Colors.accents, Palette.accent, Palette.primary};
|
Set<Color> swatches = {
|
||||||
|
...Colors.primaries,
|
||||||
|
...Colors.accents,
|
||||||
|
Palette.accent,
|
||||||
|
Palette.primary
|
||||||
|
};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -63,51 +68,49 @@ class _PlanSettingsState extends State<PlanSettings> {
|
|||||||
for (var element in (snapshot.data as List<dynamic>)) {
|
for (var element in (snapshot.data as List<dynamic>)) {
|
||||||
String subject = element['subject'];
|
String subject = element['subject'];
|
||||||
String teacher = element['teacher'];
|
String teacher = element['teacher'];
|
||||||
children.add(FutureBuilder(
|
children.add(
|
||||||
future: buildPlanColors(subject),
|
FutureBuilder(
|
||||||
builder: (context, snapshot) {
|
future: buildPlanColors(subject),
|
||||||
if (snapshot.hasData) {
|
builder: (context, snapshot) {
|
||||||
Color color = snapshot.data as Color;
|
if (snapshot.hasData) {
|
||||||
return ListTile(
|
Color color = snapshot.data as Color;
|
||||||
leading: ColorButton(
|
return ListTile(
|
||||||
key: const Key('c1'),
|
leading: ColorButton(
|
||||||
color: color,
|
key: const Key('c1'),
|
||||||
config: const ColorPickerConfig(
|
color: color,
|
||||||
enableEyePicker: false),
|
config: const ColorPickerConfig(
|
||||||
onSwatchesChanged: (Set<Color> value) {
|
enableEyePicker: false),
|
||||||
swatches = value;
|
onSwatchesChanged: (Set<Color> value) {
|
||||||
},
|
swatches = value;
|
||||||
size: 32,
|
},
|
||||||
swatches: swatches,
|
size: 32,
|
||||||
onColorChanged: (Color value) async {
|
swatches: swatches,
|
||||||
setState(() {
|
onColorChanged: (Color value) async {
|
||||||
color = value;
|
setState(() {
|
||||||
});
|
color = value;
|
||||||
SharedPreferences prefs = await SharedPreferences
|
});
|
||||||
.getInstance();
|
SharedPreferences prefs =
|
||||||
prefs.setInt(
|
await SharedPreferences
|
||||||
"color$subject", value.value);
|
.getInstance();
|
||||||
}
|
prefs.setInt(
|
||||||
),
|
"color$subject", value.value);
|
||||||
title: Text(names[subject] ?? ""),
|
}),
|
||||||
subtitle: Text(teachers[teacher] ?? ""),
|
title: Text(subjects[subject] ?? ""),
|
||||||
);
|
subtitle: Text(teachers[teacher] ?? ""),
|
||||||
} else {
|
);
|
||||||
return (const LinearProgressIndicator());
|
} else {
|
||||||
}
|
return (const LinearProgressIndicator());
|
||||||
}
|
}
|
||||||
),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Column(
|
return Column(
|
||||||
children: children,
|
children: children,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (const Center(
|
return (const Center(child: CircularProgressIndicator()));
|
||||||
child: CircularProgressIndicator()));
|
|
||||||
}
|
}
|
||||||
}
|
}),
|
||||||
),
|
|
||||||
/*FutureBuilder(
|
/*FutureBuilder(
|
||||||
future: buildPlanColors("Mat"),
|
future: buildPlanColors("Mat"),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
@ -171,7 +174,6 @@ class _PlanSettingsState extends State<PlanSettings> {
|
|||||||
}
|
}
|
||||||
),*/
|
),*/
|
||||||
],
|
],
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@ import 'package:flutter/material.dart';
|
|||||||
class ServiceSettings extends StatelessWidget {
|
class ServiceSettings extends StatelessWidget {
|
||||||
const ServiceSettings({Key? key}) : super(key: key);
|
const ServiceSettings({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -15,9 +13,7 @@ class ServiceSettings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
||||||
children: [
|
children: [],
|
||||||
|
|
||||||
],
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ class UserSettings extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
//TextEditingController nameController = TextEditingController(text: "Denys Konovalov");
|
//TextEditingController nameController = TextEditingController(text: "Denys Konovalov");
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
@ -28,41 +27,38 @@ class UserSettings extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 128.0,
|
width: 128.0,
|
||||||
height: 128.0,
|
height: 128.0,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.scaleDown,
|
fit: BoxFit.scaleDown,
|
||||||
image: AssetImage("assets/images/meincantor_r.png")
|
image:
|
||||||
)
|
AssetImage("assets/images/meincantor_r.png")))),
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
future: getSettingsString("name"),
|
future: getSettingsString("name"),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
return TextField(
|
return TextField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
labelText: 'Name',
|
labelText: 'Name',
|
||||||
),
|
),
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
controller: TextEditingController(text: snapshot.data as String),
|
controller:
|
||||||
);
|
TextEditingController(text: snapshot.data as String),
|
||||||
} else {
|
);
|
||||||
return (const Center(child: CircularProgressIndicator()));
|
} else {
|
||||||
}
|
return (const Center(child: CircularProgressIndicator()));
|
||||||
}
|
}
|
||||||
),
|
}),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(5, 20, 5, 5),
|
padding: const EdgeInsets.fromLTRB(5, 20, 5, 5),
|
||||||
child: buildClassesChooser()
|
child: buildClassesChooser()),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,8 @@ class Settings extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
padding: const EdgeInsets.fromLTRB(5, 5, 5, 5),
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(MdiIcons.accountSettingsOutline, color: Colors.cyan),
|
leading: const Icon(MdiIcons.accountSettingsOutline,
|
||||||
|
color: Colors.cyan),
|
||||||
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
||||||
title: const Text("Benutzer"),
|
title: const Text("Benutzer"),
|
||||||
subtitle: const Text("Profilbild, Klasse & mehr"),
|
subtitle: const Text("Profilbild, Klasse & mehr"),
|
||||||
@ -35,7 +36,8 @@ class Settings extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(MdiIcons.timetable, color: Colors.orangeAccent),
|
leading:
|
||||||
|
const Icon(MdiIcons.timetable, color: Colors.orangeAccent),
|
||||||
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
||||||
title: const Text("Plan"),
|
title: const Text("Plan"),
|
||||||
subtitle: const Text("Kurse/Fächer, Farben & mehr"),
|
subtitle: const Text("Kurse/Fächer, Farben & mehr"),
|
||||||
@ -47,14 +49,16 @@ class Settings extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.color_lens_outlined, color: Colors.pinkAccent),
|
leading: const Icon(Icons.color_lens_outlined,
|
||||||
|
color: Colors.pinkAccent),
|
||||||
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
||||||
title: const Text("Aussehen"),
|
title: const Text("Aussehen"),
|
||||||
subtitle: const Text("Widgets, Design & mehr"),
|
subtitle: const Text("Widgets, Design & mehr"),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => const AppearanceSettings()),
|
MaterialPageRoute(
|
||||||
|
builder: (context) => const AppearanceSettings()),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -66,24 +70,27 @@ class Settings extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => const ServiceSettings()),
|
MaterialPageRoute(
|
||||||
|
builder: (context) => const ServiceSettings()),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.developer_mode_outlined, color: Colors.deepOrangeAccent),
|
leading: const Icon(Icons.developer_mode_outlined,
|
||||||
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
color: Colors.deepOrangeAccent),
|
||||||
title: const Text("Entwickleroptionen"),
|
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
||||||
subtitle: const Text("API, Benutzerdaten & mehr"),
|
title: const Text("Entwickleroptionen"),
|
||||||
onTap: () {
|
subtitle: const Text("API, Benutzerdaten & mehr"),
|
||||||
Navigator.push(
|
onTap: () {
|
||||||
context,
|
Navigator.push(
|
||||||
MaterialPageRoute(builder: (context) => const DevSettings()),
|
context,
|
||||||
);
|
MaterialPageRoute(builder: (context) => const DevSettings()),
|
||||||
},
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.info_outlined, color: Colors.greenAccent),
|
leading:
|
||||||
|
const Icon(Icons.info_outlined, color: Colors.greenAccent),
|
||||||
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
|
||||||
title: const Text("Informationen"),
|
title: const Text("Informationen"),
|
||||||
subtitle: const Text("Version, Lizenzen & mehr"),
|
subtitle: const Text("Version, Lizenzen & mehr"),
|
||||||
@ -97,4 +104,4 @@ class Settings extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
//import 'package:MeinCantor/timetable.dart';
|
|
||||||
//import 'package:MeinCantor/main.dart';
|
|
||||||
import 'package:MeinCantor/raumuebersicht.dart';
|
import 'package:MeinCantor/raumuebersicht.dart';
|
||||||
import 'package:MeinCantor/schulbibliothek.dart';
|
import 'package:MeinCantor/schulbibliothek.dart';
|
||||||
import 'package:MeinCantor/schulcomputer.dart';
|
import 'package:MeinCantor/schulcomputer.dart';
|
||||||
|
import 'package:MeinCantor/schuelerzeitung.dart';
|
||||||
|
import 'package:MeinCantor/Settings/dashboard.dart';
|
||||||
|
|
||||||
|
import 'package:MeinCantor/main.dart';
|
||||||
|
import 'package:MeinCantor/networking.dart';
|
||||||
|
import 'package:MeinCantor/login.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'Settings/dashboard.dart';
|
|
||||||
// import 'settings.dart';
|
|
||||||
import 'main.dart';
|
|
||||||
import 'networking.dart';
|
|
||||||
import 'login.dart';
|
|
||||||
import 'schuelerzeitung.dart';
|
|
||||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||||
|
|
||||||
class Dashboard extends StatefulWidget {
|
class Dashboard extends StatefulWidget {
|
||||||
@ -30,7 +29,6 @@ Future<String> getSettingsString(String key) async {
|
|||||||
if (value == null || value.isEmpty) {
|
if (value == null || value.isEmpty) {
|
||||||
value = "";
|
value = "";
|
||||||
}
|
}
|
||||||
print(value);
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,19 +51,16 @@ class _DashboardState extends State<Dashboard> with RestorationMixin {
|
|||||||
final drawerElements = ListView(
|
final drawerElements = ListView(
|
||||||
children: [
|
children: [
|
||||||
UserAccountsDrawerHeader(
|
UserAccountsDrawerHeader(
|
||||||
accountName: buildSettingsString('name', const TextStyle()),
|
accountName: buildSettingsString('name', const TextStyle()),
|
||||||
accountEmail: buildSettingsString('user', const TextStyle()),
|
accountEmail: buildSettingsString('user', const TextStyle()),
|
||||||
currentAccountPicture: Image.asset("assets/images/meincantor_r.png")
|
currentAccountPicture:
|
||||||
/*const CircularProgressIndicator(
|
Image.asset("assets/images/meincantor_r.png")),
|
||||||
backgroundColor: Colors.black,
|
|
||||||
),*/
|
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
title: const Text("Einstellungen"),
|
title: const Text("Einstellungen"),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => Settings()),
|
MaterialPageRoute(builder: (context) => const Settings()),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
leading: const Icon(Icons.settings_outlined),
|
leading: const Icon(Icons.settings_outlined),
|
||||||
@ -90,12 +85,9 @@ class _DashboardState extends State<Dashboard> with RestorationMixin {
|
|||||||
label: "Startseite",
|
label: "Startseite",
|
||||||
),
|
),
|
||||||
const BottomNavigationBarItem(
|
const BottomNavigationBarItem(
|
||||||
icon: Icon(MdiIcons.timetable),
|
icon: Icon(MdiIcons.timetable), label: "Vertretungsplan"),
|
||||||
label: "Vertretungsplan"),
|
|
||||||
const BottomNavigationBarItem(
|
const BottomNavigationBarItem(
|
||||||
icon: Icon(Icons.notifications_outlined),
|
icon: Icon(Icons.notifications_outlined), label: "Hinweise"),
|
||||||
label: "Hinweise"
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
@ -115,7 +107,6 @@ class _DashboardState extends State<Dashboard> with RestorationMixin {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_currentIndex.value = index;
|
_currentIndex.value = index;
|
||||||
});
|
});
|
||||||
//print(index);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -139,47 +130,47 @@ class _DashboardBottomNavView extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (item.label == "Startseite") {
|
if (item.label == "Startseite") {
|
||||||
double _timeOfDayToDouble(TimeOfDay tod) => tod.hour + tod.minute / 60.0;
|
double _timeOfDayToDouble(TimeOfDay tod) => tod.hour + tod.minute / 60.0;
|
||||||
var lessonCount;
|
int lessonCount;
|
||||||
if (_timeOfDayToDouble(TimeOfDay.now()) <=
|
if (_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 7, minute: 30))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 7, minute: 30))) {
|
||||||
lessonCount = 1;
|
lessonCount = 1;
|
||||||
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 7, minute: 30)) &&
|
_timeOfDayToDouble(const TimeOfDay(hour: 7, minute: 30)) &&
|
||||||
_timeOfDayToDouble(TimeOfDay.now()) <=
|
_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 8, minute: 20))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 8, minute: 20))) {
|
||||||
lessonCount = 2;
|
lessonCount = 2;
|
||||||
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 8, minute: 20)) &&
|
_timeOfDayToDouble(const TimeOfDay(hour: 8, minute: 20)) &&
|
||||||
_timeOfDayToDouble(TimeOfDay.now()) <=
|
_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 9, minute: 25))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 9, minute: 25))) {
|
||||||
lessonCount = 3;
|
lessonCount = 3;
|
||||||
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 9, minute: 25)) &&
|
_timeOfDayToDouble(const TimeOfDay(hour: 9, minute: 25)) &&
|
||||||
_timeOfDayToDouble(TimeOfDay.now()) <=
|
_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 10, minute: 15))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 10, minute: 15))) {
|
||||||
lessonCount = 4;
|
lessonCount = 4;
|
||||||
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 10, minute: 15)) &&
|
_timeOfDayToDouble(const TimeOfDay(hour: 10, minute: 15)) &&
|
||||||
_timeOfDayToDouble(TimeOfDay.now()) <=
|
_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 11, minute: 30))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 11, minute: 30))) {
|
||||||
lessonCount = 5;
|
lessonCount = 5;
|
||||||
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 11, minute: 30)) &&
|
_timeOfDayToDouble(const TimeOfDay(hour: 11, minute: 30)) &&
|
||||||
_timeOfDayToDouble(TimeOfDay.now()) <=
|
_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 12, minute: 20))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 12, minute: 20))) {
|
||||||
lessonCount = 6;
|
lessonCount = 6;
|
||||||
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 12, minute: 20)) &&
|
_timeOfDayToDouble(const TimeOfDay(hour: 12, minute: 20)) &&
|
||||||
_timeOfDayToDouble(TimeOfDay.now()) <=
|
_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 13, minute: 30))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 13, minute: 30))) {
|
||||||
lessonCount = 7;
|
lessonCount = 7;
|
||||||
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 13, minute: 30)) &&
|
_timeOfDayToDouble(const TimeOfDay(hour: 13, minute: 30)) &&
|
||||||
_timeOfDayToDouble(TimeOfDay.now()) <=
|
_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 14, minute: 20))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 14, minute: 20))) {
|
||||||
lessonCount = 8;
|
lessonCount = 8;
|
||||||
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
} else if (_timeOfDayToDouble(TimeOfDay.now()) >
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 14, minute: 20)) &&
|
_timeOfDayToDouble(const TimeOfDay(hour: 14, minute: 20)) &&
|
||||||
_timeOfDayToDouble(TimeOfDay.now()) <=
|
_timeOfDayToDouble(TimeOfDay.now()) <=
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: 15, minute: 10))) {
|
_timeOfDayToDouble(const TimeOfDay(hour: 15, minute: 10))) {
|
||||||
lessonCount = 9;
|
lessonCount = 9;
|
||||||
@ -187,409 +178,216 @@ class _DashboardBottomNavView extends StatelessWidget {
|
|||||||
lessonCount = -1;
|
lessonCount = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
Widget timetable;
|
|
||||||
if (_timeOfDayToDouble(TimeOfDay.now()) >
|
|
||||||
_timeOfDayToDouble(const TimeOfDay(hour: , minute: 55))) {
|
|
||||||
timetable = buildClassTimetable();
|
|
||||||
} else {
|
|
||||||
timetable = buildTodayClassTimetable();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
print(lessonCount);
|
|
||||||
var view = SingleChildScrollView(
|
var view = SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(children: [
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Padding(
|
||||||
mainAxisSize: MainAxisSize.max,
|
padding: const EdgeInsets.fromLTRB(20, 30, 20, 5),
|
||||||
children: [
|
child: Text(
|
||||||
Padding(
|
'Hallo,',
|
||||||
padding: const EdgeInsets.fromLTRB(20, 30, 20, 5),
|
style: GoogleFonts.robotoSlab(
|
||||||
child: Text(
|
fontSize: 20,
|
||||||
'Hallo,',
|
|
||||||
style: GoogleFonts.robotoSlab(
|
|
||||||
fontSize: 20,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
|
|
||||||
child: buildSettingsString(
|
|
||||||
"name",
|
|
||||||
GoogleFonts.robotoSlab(
|
|
||||||
fontSize: 28,
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.fromLTRB(20, 10, 0, 10),
|
|
||||||
child: Text(
|
|
||||||
'Deine nächste Unterrichtsstunde:',
|
|
||||||
style: GoogleFonts.robotoSlab(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w100,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(20, 20, 20, 10),
|
padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
|
||||||
child: buildTodayClassTimetableLesson(lessonCount),
|
child: buildSettingsString(
|
||||||
),
|
"name",
|
||||||
|
GoogleFonts.robotoSlab(
|
||||||
|
fontSize: 28,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(20, 20, 20, 10),
|
padding: const EdgeInsets.fromLTRB(20, 10, 0, 10),
|
||||||
child: Wrap(
|
child: Text(
|
||||||
children: [
|
'Deine nächste Unterrichtsstunde:',
|
||||||
SizedBox(
|
style: GoogleFonts.robotoSlab(
|
||||||
child: GestureDetector(
|
fontSize: 20,
|
||||||
onTap: () async {
|
fontWeight: FontWeight.w100,
|
||||||
Navigator.push(
|
),
|
||||||
context,
|
),
|
||||||
MaterialPageRoute(builder: (context) => const SZ()),
|
)
|
||||||
);
|
],
|
||||||
},
|
),
|
||||||
child: Card(
|
Padding(
|
||||||
shape: RoundedRectangleBorder(
|
padding: const EdgeInsets.fromLTRB(20, 20, 20, 10),
|
||||||
borderRadius: BorderRadius.circular(10),
|
child: buildTodayClassTimetableLesson(lessonCount),
|
||||||
),
|
),
|
||||||
child: const Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(10),
|
padding: const EdgeInsets.fromLTRB(20, 20, 20, 10),
|
||||||
child: ListTile(
|
child: Wrap(
|
||||||
title: Padding(
|
children: [
|
||||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
SizedBox(
|
||||||
child: Icon(
|
child: GestureDetector(
|
||||||
MdiIcons.newspaper,
|
onTap: () async {
|
||||||
color: Palette.accent,
|
Navigator.push(
|
||||||
size: 48,
|
context,
|
||||||
),
|
MaterialPageRoute(builder: (context) => const SZ()),
|
||||||
),
|
);
|
||||||
subtitle: Center(
|
},
|
||||||
child: Padding(
|
child: Card(
|
||||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
shape: RoundedRectangleBorder(
|
||||||
child: Text(
|
borderRadius: BorderRadius.circular(10),
|
||||||
'Schülerzeitung',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
width: 175,
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
child: const Padding(
|
||||||
width: 175,
|
padding: EdgeInsets.all(10),
|
||||||
child: GestureDetector(
|
child: ListTile(
|
||||||
onTap: () async {
|
title: Padding(
|
||||||
Navigator.push(
|
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
||||||
context,
|
child: Icon(
|
||||||
MaterialPageRoute(builder: (context) => const SB()),
|
MdiIcons.newspaper,
|
||||||
);
|
color: Palette.accent,
|
||||||
},
|
size: 48,
|
||||||
child: Card(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: ListTile(
|
|
||||||
title: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
|
||||||
child: Icon(
|
|
||||||
MdiIcons.libraryShelves,
|
|
||||||
color: Palette.accent,
|
|
||||||
size: 48,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
|
||||||
child: Text(
|
|
||||||
'Schulbibliothek',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 175,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => const SC()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Card(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: ListTile(
|
|
||||||
title: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
|
||||||
child: Icon(
|
|
||||||
MdiIcons.laptop,
|
|
||||||
color: Palette.accent,
|
|
||||||
size: 48,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
|
||||||
child: Text(
|
|
||||||
'Schulcomputer',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 175,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => const RoomOverview()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Card(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: const Padding(
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
child: ListTile(
|
|
||||||
title: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
|
||||||
child: Icon(
|
|
||||||
MdiIcons.door,
|
|
||||||
color: Palette.accent,
|
|
||||||
size: 48,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
|
||||||
child: Text(
|
|
||||||
'Raumübersicht',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
/*GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => const SZ()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Card(
|
|
||||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
//mainAxisSize: MainAxisSize.max,
|
|
||||||
children: const [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(20, 20, 20, 10),
|
|
||||||
child: Icon(
|
|
||||||
MdiIcons.newspaper,
|
|
||||||
color: Palette.accent,
|
|
||||||
size: 48,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
//mainAxisSize: MainAxisSize.max,
|
|
||||||
children: const [
|
|
||||||
Align(
|
|
||||||
alignment: Alignment(0, 0),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(15, 50, 15, 15),
|
|
||||||
child: Text(
|
|
||||||
'Schülerzeitung',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => const SB()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Card(
|
|
||||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: const [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(20, 20, 20, 10),
|
|
||||||
child: Icon(
|
|
||||||
MdiIcons.libraryShelves,
|
|
||||||
color: Color(0xFFFFBC3B),
|
|
||||||
size: 48,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: const [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(15, 50, 15, 15),
|
|
||||||
child: Text(
|
|
||||||
'Schulbibliothek',
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => const SC()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Card(
|
|
||||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
),
|
||||||
child: Column(
|
subtitle: Center(
|
||||||
mainAxisSize: MainAxisSize.max,
|
child: Padding(
|
||||||
children: [
|
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||||
Row(
|
child: Text(
|
||||||
mainAxisSize: MainAxisSize.max,
|
'Schülerzeitung',
|
||||||
children: const [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(20, 20, 20, 10),
|
|
||||||
child: Icon(
|
|
||||||
MdiIcons.laptop,
|
|
||||||
color: Color(0xFFFFBC3B),
|
|
||||||
size: 48,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Row(
|
),
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: const [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(15, 50, 15, 15),
|
|
||||||
child: Text(
|
|
||||||
'Schulcomputer',
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
)),
|
||||||
GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => const RoomOverview()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Card(
|
|
||||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: const [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(20, 20, 20, 10),
|
|
||||||
child: Icon(
|
|
||||||
MdiIcons.door,
|
|
||||||
color: Color(0xFFFFBC3B),
|
|
||||||
size: 48,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: const [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(15, 50, 15, 15),
|
|
||||||
child: Text(
|
|
||||||
'Raumübersicht',
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),*/
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
]),
|
width: 175,
|
||||||
);
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 175,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => const SB()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Card(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: ListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
||||||
|
child: Icon(
|
||||||
|
MdiIcons.libraryShelves,
|
||||||
|
color: Palette.accent,
|
||||||
|
size: 48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||||
|
child: Text(
|
||||||
|
'Schulbibliothek',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 175,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => const SC()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Card(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: ListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
||||||
|
child: Icon(
|
||||||
|
MdiIcons.laptop,
|
||||||
|
color: Palette.accent,
|
||||||
|
size: 48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||||
|
child: Text(
|
||||||
|
'Schulcomputer',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 175,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => const RoomOverview()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Card(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: ListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
||||||
|
child: Icon(
|
||||||
|
MdiIcons.door,
|
||||||
|
color: Palette.accent,
|
||||||
|
size: 48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||||
|
child: Text(
|
||||||
|
'Raumübersicht',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
);
|
||||||
return view;
|
return view;
|
||||||
} else if (item.label == "Vertretungsplan") {
|
} else if (item.label == "Vertretungsplan") {
|
||||||
return LayoutBuilder(builder: (context, constraints) {
|
return LayoutBuilder(builder: (context, constraints) {
|
||||||
double widgetWidth = constraints.maxWidth;
|
double widgetWidth = constraints.maxWidth;
|
||||||
// double widgetHeight = constraints.maxHeight;
|
|
||||||
var factor;
|
int factor;
|
||||||
|
|
||||||
if (widgetWidth <= 600) {
|
if (widgetWidth <= 600) {
|
||||||
factor = 1;
|
factor = 1;
|
||||||
@ -597,6 +395,8 @@ class _DashboardBottomNavView extends StatelessWidget {
|
|||||||
factor = 2;
|
factor = 2;
|
||||||
} else if (widgetWidth <= 2000) {
|
} else if (widgetWidth <= 2000) {
|
||||||
factor = 3;
|
factor = 3;
|
||||||
|
} else {
|
||||||
|
factor = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// print(screenType);
|
// print(screenType);
|
||||||
@ -629,10 +429,6 @@ class _DashboardBottomNavView extends StatelessWidget {
|
|||||||
text: "Neuster Plan",
|
text: "Neuster Plan",
|
||||||
icon: Icon(CupertinoIcons.calendar),
|
icon: Icon(CupertinoIcons.calendar),
|
||||||
),
|
),
|
||||||
/*Tab(
|
|
||||||
text: "Archiv",
|
|
||||||
icon: Icon(CupertinoIcons.archivebox),
|
|
||||||
),*/
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -652,4 +448,4 @@ class _DashboardBottomNavView extends StatelessWidget {
|
|||||||
return const Center(child: Text("Derzeit nichts hier..."));
|
return const Center(child: Text("Derzeit nichts hier..."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ class Login extends StatelessWidget {
|
|||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
const Dashboard()),
|
const Dashboard()),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,8 @@ class App extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
darkTheme: ThemeData.from(
|
darkTheme: ThemeData.from(
|
||||||
colorScheme: const ColorScheme.dark(primary: Palette.accent, secondary: Palette.accent)),
|
colorScheme: const ColorScheme.dark(
|
||||||
|
primary: Palette.accent, secondary: Palette.accent)),
|
||||||
title: "GCG.MeinCantor",
|
title: "GCG.MeinCantor",
|
||||||
home: buildHomePage(),
|
home: buildHomePage(),
|
||||||
);
|
);
|
||||||
|
@ -5,9 +5,20 @@ import 'package:flutter/painting.dart';
|
|||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'timetable.dart';
|
import 'package:MeinCantor/const.dart';
|
||||||
import 'login.dart';
|
import 'package:MeinCantor/timetable.dart';
|
||||||
import 'main.dart';
|
import 'package:MeinCantor/login.dart';
|
||||||
|
import 'package:MeinCantor/main.dart';
|
||||||
|
|
||||||
|
Future<http.Response> getArticles() async {
|
||||||
|
print("hjkl0");
|
||||||
|
var uri = Uri.https(szUrl["url"]!, "/articles");
|
||||||
|
print(uri.toString());
|
||||||
|
final response = await http.get(uri);
|
||||||
|
print("hji");
|
||||||
|
print(response);
|
||||||
|
return (response);
|
||||||
|
}
|
||||||
|
|
||||||
Future<http.Response> getToken(
|
Future<http.Response> getToken(
|
||||||
String user, String password, String otp, String devId) async {
|
String user, String password, String otp, String devId) async {
|
||||||
@ -47,7 +58,9 @@ Future<http.Response> fetchClassTimetable() async {
|
|||||||
var uri = Uri.https("mein.cantorgymnasium.de", "/api/timetable/$classNum");
|
var uri = Uri.https("mein.cantorgymnasium.de", "/api/timetable/$classNum");
|
||||||
var headers = {"x-api-key": "$apiKey"};
|
var headers = {"x-api-key": "$apiKey"};
|
||||||
print(uri);
|
print(uri);
|
||||||
final response = http.get(uri, headers: headers).onError((error, stackTrace) { return(http.Response("", 404)); } );
|
final response = http.get(uri, headers: headers).onError((error, stackTrace) {
|
||||||
|
return (http.Response("", 404));
|
||||||
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +78,9 @@ Future<http.Response> fetchTodayClassTimetable() async {
|
|||||||
Uri.https("mein.cantorgymnasium.de", "/api/timetable/$classNum/today");
|
Uri.https("mein.cantorgymnasium.de", "/api/timetable/$classNum/today");
|
||||||
var headers = {"x-api-key": "$apiKey"};
|
var headers = {"x-api-key": "$apiKey"};
|
||||||
print(uri);
|
print(uri);
|
||||||
final response = http.get(uri, headers: headers).onError((error, stackTrace) { return(http.Response("", 404)); } );
|
final response = http.get(uri, headers: headers).onError((error, stackTrace) {
|
||||||
|
return (http.Response("", 404));
|
||||||
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,10 +95,12 @@ Future<http.Response> fetchTomorrowClassTimetable() async {
|
|||||||
}
|
}
|
||||||
var apiKey = prefs.getString('api_key');
|
var apiKey = prefs.getString('api_key');
|
||||||
var uri =
|
var uri =
|
||||||
Uri.https("mein.cantorgymnasium.de", "/api/timetable/$classNum/tomorrow");
|
Uri.https("mein.cantorgymnasium.de", "/api/timetable/$classNum/tomorrow");
|
||||||
var headers = {"x-api-key": "$apiKey"};
|
var headers = {"x-api-key": "$apiKey"};
|
||||||
print(uri);
|
print(uri);
|
||||||
final response = http.get(uri, headers: headers).onError((error, stackTrace) { return(http.Response("", 404)); } );
|
final response = http.get(uri, headers: headers).onError((error, stackTrace) {
|
||||||
|
return (http.Response("", 404));
|
||||||
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +115,10 @@ fetchLessonList() async {
|
|||||||
var apiKey = prefs.getString('api_key');
|
var apiKey = prefs.getString('api_key');
|
||||||
var uri = Uri.https("mein.cantorgymnasium.de", "/api/lessons/$classNum");
|
var uri = Uri.https("mein.cantorgymnasium.de", "/api/lessons/$classNum");
|
||||||
var headers = {"x-api-key": "$apiKey"};
|
var headers = {"x-api-key": "$apiKey"};
|
||||||
final response = await http.get(uri, headers: headers).onError((error, stackTrace) { return(http.Response("", 404)); } );
|
final response =
|
||||||
|
await http.get(uri, headers: headers).onError((error, stackTrace) {
|
||||||
|
return (http.Response("", 404));
|
||||||
|
});
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
prefs.setString("lessons", utf8.decode(response.bodyBytes));
|
prefs.setString("lessons", utf8.decode(response.bodyBytes));
|
||||||
} else {
|
} else {
|
||||||
@ -106,8 +126,6 @@ fetchLessonList() async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Widget buildClassTimetable() {
|
Widget buildClassTimetable() {
|
||||||
return FutureBuilder<http.Response>(
|
return FutureBuilder<http.Response>(
|
||||||
future: fetchClassTimetable(),
|
future: fetchClassTimetable(),
|
||||||
@ -117,7 +135,8 @@ Widget buildClassTimetable() {
|
|||||||
if (statusCode == 200) {
|
if (statusCode == 200) {
|
||||||
Widget timetableView = ClassTimetableBuilder.buildView(
|
Widget timetableView = ClassTimetableBuilder.buildView(
|
||||||
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)), context)
|
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)), context)
|
||||||
.view.child;
|
.view
|
||||||
|
.child;
|
||||||
return timetableView;
|
return timetableView;
|
||||||
} else if (statusCode == 400) {
|
} else if (statusCode == 400) {
|
||||||
Navigator.pushReplacement(
|
Navigator.pushReplacement(
|
||||||
@ -125,12 +144,15 @@ Widget buildClassTimetable() {
|
|||||||
} else if (statusCode == 500) {
|
} else if (statusCode == 500) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Es konnte kein Vertretungsplan gefunden werden.")),
|
child: Center(
|
||||||
|
child: Text("Es konnte kein Vertretungsplan gefunden werden.")),
|
||||||
);
|
);
|
||||||
} else if (statusCode == 404) {
|
} else if (statusCode == 404) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support.")),
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support.")),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Center(child: Text('Error $statusCode'));
|
return Center(child: Text('Error $statusCode'));
|
||||||
@ -152,23 +174,23 @@ Widget buildTodayClassTimetable() {
|
|||||||
if (statusCode == 200) {
|
if (statusCode == 200) {
|
||||||
Widget timetableView = ClassTimetableBuilder.buildView(
|
Widget timetableView = ClassTimetableBuilder.buildView(
|
||||||
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)), context)
|
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)), context)
|
||||||
.view.child;
|
.view
|
||||||
|
.child;
|
||||||
return timetableView;
|
return timetableView;
|
||||||
} else if (statusCode == 400) {
|
} else if (statusCode == 400) {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context, MaterialPageRoute(builder: (context) => Login()));
|
context, MaterialPageRoute(builder: (context) => Login()));
|
||||||
} else if (statusCode == 500) {
|
} else if (statusCode == 500) {
|
||||||
var chars = Runes('Es konnte kein Vertretungsplan für heute gefunden werden. \u{1F937}');
|
var chars = Runes(
|
||||||
|
'Es konnte kein Vertretungsplan für heute gefunden werden. \u{1F937}');
|
||||||
List<Widget> cardChildren = [];
|
List<Widget> cardChildren = [];
|
||||||
cardChildren.add(ListTile(
|
cardChildren.add(ListTile(
|
||||||
title: Text(String.fromCharCodes(chars),
|
title: Text(String.fromCharCodes(chars),
|
||||||
style: const TextStyle(color: Palette.primary)),
|
style: const TextStyle(color: Palette.primary)),
|
||||||
)
|
));
|
||||||
);
|
|
||||||
Card card = Card(
|
Card card = Card(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(15.0),
|
borderRadius: BorderRadius.circular(15.0),
|
||||||
|
|
||||||
),
|
),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -178,12 +200,13 @@ Widget buildTodayClassTimetable() {
|
|||||||
padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
|
padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [card],
|
children: [card],
|
||||||
)
|
));
|
||||||
);
|
|
||||||
} else if (statusCode == 404) {
|
} else if (statusCode == 404) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support.")),
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support.")),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Center(child: Text('Error $statusCode'));
|
return Center(child: Text('Error $statusCode'));
|
||||||
@ -204,24 +227,24 @@ Widget buildTomorrowClassTimetable() {
|
|||||||
int statusCode = snapshot.data!.statusCode;
|
int statusCode = snapshot.data!.statusCode;
|
||||||
if (statusCode == 200) {
|
if (statusCode == 200) {
|
||||||
Widget timetableView = ClassTimetableBuilder.buildView(
|
Widget timetableView = ClassTimetableBuilder.buildView(
|
||||||
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)), context)
|
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)), context)
|
||||||
.view.child;
|
.view
|
||||||
|
.child;
|
||||||
return timetableView;
|
return timetableView;
|
||||||
} else if (statusCode == 400) {
|
} else if (statusCode == 400) {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context, MaterialPageRoute(builder: (context) => Login()));
|
context, MaterialPageRoute(builder: (context) => Login()));
|
||||||
} else if (statusCode == 500) {
|
} else if (statusCode == 500) {
|
||||||
var chars = Runes('Es konnte kein Vertretungsplan für morgen gefunden werden. \u{1F937}');
|
var chars = Runes(
|
||||||
|
'Es konnte kein Vertretungsplan für morgen gefunden werden. \u{1F937}');
|
||||||
List<Widget> cardChildren = [];
|
List<Widget> cardChildren = [];
|
||||||
cardChildren.add(ListTile(
|
cardChildren.add(ListTile(
|
||||||
title: Text(String.fromCharCodes(chars),
|
title: Text(String.fromCharCodes(chars),
|
||||||
style: const TextStyle(color: Palette.primary)),
|
style: const TextStyle(color: Palette.primary)),
|
||||||
)
|
));
|
||||||
);
|
|
||||||
Card card = Card(
|
Card card = Card(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(15.0),
|
borderRadius: BorderRadius.circular(15.0),
|
||||||
|
|
||||||
),
|
),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -231,8 +254,7 @@ Widget buildTomorrowClassTimetable() {
|
|||||||
padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
|
padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [card],
|
children: [card],
|
||||||
)
|
));
|
||||||
);
|
|
||||||
/*return const Padding(
|
/*return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Es konnte kein Vertretungsplan für heute gefunden werden.")),
|
child: Center(child: Text("Es konnte kein Vertretungsplan für heute gefunden werden.")),
|
||||||
@ -240,7 +262,9 @@ Widget buildTomorrowClassTimetable() {
|
|||||||
} else if (statusCode == 404) {
|
} else if (statusCode == 404) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support.")),
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support.")),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Center(child: Text('Error $statusCode'));
|
return Center(child: Text('Error $statusCode'));
|
||||||
@ -261,19 +285,20 @@ Widget buildClassTimetableLesson(int count) {
|
|||||||
int statusCode = snapshot.data!.statusCode;
|
int statusCode = snapshot.data!.statusCode;
|
||||||
if (statusCode == 200) {
|
if (statusCode == 200) {
|
||||||
List<Widget> lessons = LessonsListBuilder.buildList(
|
List<Widget> lessons = LessonsListBuilder.buildList(
|
||||||
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)), count: count)
|
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)),
|
||||||
|
count: count)
|
||||||
.lessons;
|
.lessons;
|
||||||
return Column(children: lessons);
|
return Column(children: lessons);
|
||||||
} else if (statusCode == 400) {
|
} else if (statusCode == 400) {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context, MaterialPageRoute(builder: (context) => Login()));
|
context, MaterialPageRoute(builder: (context) => Login()));
|
||||||
} else if (statusCode == 500) {
|
} else if (statusCode == 500) {
|
||||||
var chars = Runes('Es konnte kein Vertretungsplan für gefunden werden. \u{1F937}');
|
var chars = Runes(
|
||||||
|
'Es konnte kein Vertretungsplan für gefunden werden. \u{1F937}');
|
||||||
List<Widget> cardChildren = [];
|
List<Widget> cardChildren = [];
|
||||||
cardChildren.add(ListTile(
|
cardChildren.add(ListTile(
|
||||||
title: Text(String.fromCharCodes(chars),
|
title: Text(String.fromCharCodes(chars),
|
||||||
style: const TextStyle(color: Palette.primary))
|
style: const TextStyle(color: Palette.primary))));
|
||||||
));
|
|
||||||
Card card = Card(
|
Card card = Card(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(15.0),
|
borderRadius: BorderRadius.circular(15.0),
|
||||||
@ -290,7 +315,9 @@ Widget buildClassTimetableLesson(int count) {
|
|||||||
} else if (statusCode == 404) {
|
} else if (statusCode == 404) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support")),
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support")),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Center(child: Text('Error $statusCode'));
|
return Center(child: Text('Error $statusCode'));
|
||||||
@ -311,17 +338,18 @@ Widget buildTodayClassTimetableLesson(int count) {
|
|||||||
int statusCode = snapshot.data!.statusCode;
|
int statusCode = snapshot.data!.statusCode;
|
||||||
if (statusCode == 200) {
|
if (statusCode == 200) {
|
||||||
List<Widget> lessons = LessonsListBuilder.buildList(
|
List<Widget> lessons = LessonsListBuilder.buildList(
|
||||||
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)), count: count)
|
jsonDecode(utf8.decode(snapshot.data!.bodyBytes)),
|
||||||
|
count: count)
|
||||||
.lessons;
|
.lessons;
|
||||||
if (lessons.isNotEmpty) {
|
if (lessons.isNotEmpty) {
|
||||||
return Column(children: lessons);
|
return Column(children: lessons);
|
||||||
} else {
|
} else {
|
||||||
var chars = Runes('Keine Stunden mehr gefunden. Sieht so aus als hättest du Schluss für heute \u{1F389}');
|
var chars = Runes(
|
||||||
|
'Keine Stunden mehr gefunden. Sieht so aus als hättest du Schluss für heute \u{1F389}');
|
||||||
List<Widget> cardChildren = [];
|
List<Widget> cardChildren = [];
|
||||||
cardChildren.add(ListTile(
|
cardChildren.add(ListTile(
|
||||||
title: Text(String.fromCharCodes(chars),
|
title: Text(String.fromCharCodes(chars),
|
||||||
style: const TextStyle(color: Palette.primary))
|
style: const TextStyle(color: Palette.primary))));
|
||||||
));
|
|
||||||
Card card = Card(
|
Card card = Card(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(15.0),
|
borderRadius: BorderRadius.circular(15.0),
|
||||||
@ -336,18 +364,16 @@ Widget buildTodayClassTimetableLesson(int count) {
|
|||||||
Future.delayed(Duration.zero, () {
|
Future.delayed(Duration.zero, () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(builder: (context) => Login()),
|
||||||
builder: (context) =>
|
|
||||||
Login()),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
} else if (statusCode == 500) {
|
} else if (statusCode == 500) {
|
||||||
var chars = Runes('Es konnte kein Vertretungsplan für heute gefunden werden. \u{1F937}');
|
var chars = Runes(
|
||||||
|
'Es konnte kein Vertretungsplan für heute gefunden werden. \u{1F937}');
|
||||||
List<Widget> cardChildren = [];
|
List<Widget> cardChildren = [];
|
||||||
cardChildren.add(ListTile(
|
cardChildren.add(ListTile(
|
||||||
title: Text(String.fromCharCodes(chars),
|
title: Text(String.fromCharCodes(chars),
|
||||||
style: const TextStyle(color: Palette.primary))
|
style: const TextStyle(color: Palette.primary))));
|
||||||
));
|
|
||||||
Card card = Card(
|
Card card = Card(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(15.0),
|
borderRadius: BorderRadius.circular(15.0),
|
||||||
@ -364,7 +390,9 @@ Widget buildTodayClassTimetableLesson(int count) {
|
|||||||
} else if (statusCode == 404) {
|
} else if (statusCode == 404) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support")),
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support")),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Center(child: Text('Error $statusCode'));
|
return Center(child: Text('Error $statusCode'));
|
||||||
@ -383,7 +411,9 @@ Future<http.Response> fetchClassesList() async {
|
|||||||
var uri = Uri.https("mein.cantorgymnasium.de", "/api/classes");
|
var uri = Uri.https("mein.cantorgymnasium.de", "/api/classes");
|
||||||
var headers = {"x-api-key": "$apiKey"};
|
var headers = {"x-api-key": "$apiKey"};
|
||||||
print(uri);
|
print(uri);
|
||||||
final response = http.get(uri, headers: headers).onError((error, stackTrace) { return(http.Response("", 404)); } );
|
final response = http.get(uri, headers: headers).onError((error, stackTrace) {
|
||||||
|
return (http.Response("", 404));
|
||||||
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,12 +435,16 @@ Widget buildClassesChooser() {
|
|||||||
} else if (statusCode == 500) {
|
} else if (statusCode == 500) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Serverfehler. Bitte wende dich an den MeinCantor-Support.")),
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"Serverfehler. Bitte wende dich an den MeinCantor-Support.")),
|
||||||
);
|
);
|
||||||
} else if (statusCode == 404) {
|
} else if (statusCode == 404) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
child: Center(child: Text("Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support")),
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"Keine Verbindung mit dem MeinCantor-Server möglich. Bitte prüfe deine Internetverbindung und deine DNS-Einstellungen oder wende dich an den MeinCantor-Support")),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Text('$statusCode');
|
return Text('$statusCode');
|
||||||
|
@ -42,4 +42,4 @@ dynamic colors = {
|
|||||||
'Frz': Colors.amberAccent[700],
|
'Frz': Colors.amberAccent[700],
|
||||||
'frz1': Colors.amberAccent[700],
|
'frz1': Colors.amberAccent[700],
|
||||||
'---': Colors.white
|
'---': Colors.white
|
||||||
};
|
};
|
@ -1,4 +1,5 @@
|
|||||||
dynamic names = {
|
dynamic subjects = {
|
||||||
|
'---': '---',
|
||||||
'Bio': 'Biologie',
|
'Bio': 'Biologie',
|
||||||
'Mat': 'Mathematik',
|
'Mat': 'Mathematik',
|
||||||
'matL1': 'Mathematik Leistungskurs 1',
|
'matL1': 'Mathematik Leistungskurs 1',
|
||||||
@ -15,7 +16,6 @@ dynamic names = {
|
|||||||
'frz2': 'Französisch 2',
|
'frz2': 'Französisch 2',
|
||||||
'frz3': 'Französisch 3',
|
'frz3': 'Französisch 3',
|
||||||
'Phy': 'Physik',
|
'Phy': 'Physik',
|
||||||
'---': '---',
|
|
||||||
'Spo': 'Sport',
|
'Spo': 'Sport',
|
||||||
'Deu': 'Deutsch',
|
'Deu': 'Deutsch',
|
||||||
'deu1': 'Deutsch 1',
|
'deu1': 'Deutsch 1',
|
||||||
@ -30,4 +30,4 @@ dynamic names = {
|
|||||||
'FK': 'Fachkurs',
|
'FK': 'Fachkurs',
|
||||||
'JIA': 'Junior-Ingenieur-Akademie',
|
'JIA': 'Junior-Ingenieur-Akademie',
|
||||||
'WoU': 'Wahlobligatorischer Unterricht'
|
'WoU': 'Wahlobligatorischer Unterricht'
|
||||||
};
|
};
|
@ -52,4 +52,4 @@ dynamic teachers = {
|
|||||||
'Henk': 'Frau Henke',
|
'Henk': 'Frau Henke',
|
||||||
'Wolf': 'Herr Wolf',
|
'Wolf': 'Herr Wolf',
|
||||||
'Gitt': 'Herr Gitter',
|
'Gitt': 'Herr Gitter',
|
||||||
};
|
};
|
@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class RoomOverview extends StatelessWidget {
|
class RoomOverview extends StatelessWidget {
|
||||||
const RoomOverview ({Key? key}) : super(key: key);
|
const RoomOverview({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:MeinCantor/networking.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||||
|
|
||||||
class SZ extends StatelessWidget {
|
class SZ extends StatelessWidget {
|
||||||
const SZ({Key? key}) : super(key: key);
|
const SZ({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@ -11,45 +17,93 @@ class SZ extends StatelessWidget {
|
|||||||
title: const Text("Schülerzeitung"),
|
title: const Text("Schülerzeitung"),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: FutureBuilder<http.Response>(
|
||||||
children: [
|
future: getArticles(),
|
||||||
Card(
|
builder: (context, snapshot) {
|
||||||
child: Column(children: [
|
if (snapshot.hasData) {
|
||||||
Padding(
|
int statusCode = snapshot.data!.statusCode;
|
||||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
if (statusCode == 200) {
|
||||||
child: ListTile(
|
String data = utf8.decode(snapshot.data!.bodyBytes);
|
||||||
onTap: () {
|
List articles = jsonDecode(data);
|
||||||
Navigator.push(
|
List<Widget> articleTiles = [];
|
||||||
context,
|
for (var element in articles) {
|
||||||
MaterialPageRoute(builder: (context) => Article()),
|
Card card = Card(
|
||||||
);
|
child: Column(children: [
|
||||||
},
|
Padding(
|
||||||
title: const Text(
|
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
"Schülersprecherwahl 2021: Kandidatenduos im Interview",
|
child: ListTile(
|
||||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
onTap: () {
|
||||||
subtitle: const Text(
|
Navigator.push(
|
||||||
"17.09.2021, Halle(Saale) Drei Trios stellen sich dieses Jahr zur Wahl...")),
|
context,
|
||||||
)
|
MaterialPageRoute(builder: (context) => Article.fromData(element["title"], element["content"], element["author"], element["published_at"]).widget),
|
||||||
]),
|
);
|
||||||
shape: RoundedRectangleBorder(
|
},
|
||||||
borderRadius: BorderRadius.circular(15),
|
title: Text(element["title"],
|
||||||
),
|
style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||||
)
|
subtitle: Text(
|
||||||
],
|
element["summary"])),
|
||||||
)
|
)
|
||||||
/*const Center(
|
]),
|
||||||
child: Text("Derzeit nichts hier..."),
|
shape: RoundedRectangleBorder(
|
||||||
)*/
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
articleTiles.add(card);
|
||||||
|
}
|
||||||
|
return ListView(
|
||||||
|
children: articleTiles.reversed.toList(),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return(const Center(
|
||||||
|
child: Text("Uups... Irgendwas ist schief gelaufen")
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return(const Center(
|
||||||
|
child: CircularProgressIndicator()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Article extends StatelessWidget {
|
class Article {
|
||||||
const Article({Key? key}) : super(key: key);
|
Widget widget;
|
||||||
|
//const Article({Key? key}) : super(key: key);
|
||||||
@override
|
Article({required this.widget});
|
||||||
Widget build(BuildContext context) {
|
factory Article.fromData(String title, String content, String author, String publishDate, ) {
|
||||||
|
return Article(widget: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Text(title)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
centerTitle: true,
|
||||||
|
),
|
||||||
|
body: ListView(
|
||||||
|
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(MdiIcons.accountOutline),
|
||||||
|
title: Text(author),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(MdiIcons.calendarOutline),
|
||||||
|
title: Text("${DateTime.parse(publishDate).day.toString()}.${DateTime.parse(publishDate).month.toString()}.${DateTime.parse(publishDate).year.toString()}"),
|
||||||
|
),
|
||||||
|
Text(content)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//@override
|
||||||
|
/*Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text(
|
title: const Text(
|
||||||
@ -70,5 +124,5 @@ class Article extends StatelessWidget {
|
|||||||
""")
|
""")
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class SB extends StatelessWidget {
|
class SB extends StatelessWidget {
|
||||||
const SB ({Key? key}) : super(key: key);
|
const SB({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class SC extends StatelessWidget {
|
class SC extends StatelessWidget {
|
||||||
const SC ({Key? key}) : super(key: key);
|
const SC({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -1,56 +1,56 @@
|
|||||||
import 'package:MeinCantor/teacher_presets.dart';
|
import 'package:MeinCantor/presets/teachers.dart';
|
||||||
|
import 'package:MeinCantor/presets/subjects.dart';
|
||||||
|
import 'package:MeinCantor/presets/colors.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'subject_presets.dart';
|
|
||||||
|
|
||||||
import 'color_presets.dart';
|
|
||||||
|
|
||||||
class ClassTimetableBuilder {
|
class ClassTimetableBuilder {
|
||||||
final RefreshIndicator view;
|
final RefreshIndicator view;
|
||||||
ClassTimetableBuilder({required this.view});
|
ClassTimetableBuilder({required this.view});
|
||||||
factory ClassTimetableBuilder.buildView(Map<String, dynamic> json, BuildContext context) {
|
factory ClassTimetableBuilder.buildView(
|
||||||
|
Map<String, dynamic> json, BuildContext context) {
|
||||||
List<Widget> list = LessonsListBuilder.buildList(json).lessons;
|
List<Widget> list = LessonsListBuilder.buildList(json).lessons;
|
||||||
String info = TimetableInfo.fromJson(json).info;
|
String info = TimetableInfo.fromJson(json).info;
|
||||||
if(info.isNotEmpty) {
|
if (info.isNotEmpty) {
|
||||||
list.insert(0, ListTile(title: Text("Informationen"), leading: Icon(MdiIcons.information), onTap: () {
|
list.insert(
|
||||||
showModalBottomSheet<void>(
|
0,
|
||||||
isScrollControlled: true,
|
ListTile(
|
||||||
shape: RoundedRectangleBorder(
|
title: const Text("Informationen"),
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
leading: const Icon(MdiIcons.information),
|
||||||
),
|
onTap: () {
|
||||||
context: context,
|
showModalBottomSheet<void>(
|
||||||
builder: (BuildContext context) {
|
isScrollControlled: true,
|
||||||
return Container(
|
shape: RoundedRectangleBorder(
|
||||||
height: 400,
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
child: ListView(
|
),
|
||||||
//mainAxisAlignment: MainAxisAlignment.center,
|
context: context,
|
||||||
//mainAxisSize: MainAxisSize.min,
|
builder: (BuildContext context) {
|
||||||
children: <Widget>[
|
return SizedBox(
|
||||||
ListTile(
|
height: 400,
|
||||||
title: Text("Informationen", style: TextStyle(fontWeight: FontWeight.bold)),
|
child: ListView(
|
||||||
leading: Icon(Icons.arrow_back),
|
children: <Widget>[
|
||||||
onTap: () {
|
ListTile(
|
||||||
Navigator.of(context).pop();
|
title: const Text("Informationen",
|
||||||
},
|
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||||
),
|
leading: const Icon(Icons.arrow_back),
|
||||||
Padding(
|
onTap: () {
|
||||||
padding: const EdgeInsets.all(20),
|
Navigator.of(context).pop();
|
||||||
child: Text(info),
|
},
|
||||||
),
|
),
|
||||||
/*ElevatedButton(
|
Padding(
|
||||||
child: const Text('Close BottomSheet'),
|
padding: const EdgeInsets.all(20),
|
||||||
onPressed: () => Navigator.pop(context),
|
child: Text(info),
|
||||||
)*/
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return ClassTimetableBuilder(
|
return ClassTimetableBuilder(
|
||||||
view: RefreshIndicator(
|
view: RefreshIndicator(
|
||||||
@ -58,11 +58,10 @@ class ClassTimetableBuilder {
|
|||||||
return Future.delayed(const Duration(seconds: 1));
|
return Future.delayed(const Duration(seconds: 1));
|
||||||
},
|
},
|
||||||
child: ListView(
|
child: ListView(
|
||||||
//shrinkWrap: true,
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
children: list,
|
children: list,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,11 +79,11 @@ Future<Color> buildLessonColor(String lesson) async {
|
|||||||
class LessonsListBuilder {
|
class LessonsListBuilder {
|
||||||
final List<Widget> lessons;
|
final List<Widget> lessons;
|
||||||
LessonsListBuilder({required this.lessons});
|
LessonsListBuilder({required this.lessons});
|
||||||
factory LessonsListBuilder.buildList(Map<String, dynamic> json, {int count: 0}) {
|
factory LessonsListBuilder.buildList(Map<String, dynamic> json,
|
||||||
|
{int count = 0}) {
|
||||||
List<Widget> children = [];
|
List<Widget> children = [];
|
||||||
ClassTimetable.fromJson(json).timetable.forEach((element) {
|
for (var element in ClassTimetable.fromJson(json).timetable) {
|
||||||
List<Widget> cardChildren = [];
|
List<Widget> cardChildren = [];
|
||||||
print(element.count.toString() + " " + count.toString());
|
|
||||||
if (element.count.toString() == count.toString() || count == 0) {
|
if (element.count.toString() == count.toString() || count == 0) {
|
||||||
cardChildren.add(ListTile(
|
cardChildren.add(ListTile(
|
||||||
title: Text(element.count.toString() + '.' + ' ' + element.name,
|
title: Text(element.count.toString() + '.' + ' ' + element.name,
|
||||||
@ -123,7 +122,7 @@ class LessonsListBuilder {
|
|||||||
);
|
);
|
||||||
children.add(card);
|
children.add(card);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
return LessonsListBuilder(lessons: children);
|
return LessonsListBuilder(lessons: children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,55 +139,55 @@ class ClassTimetable {
|
|||||||
final List timetable;
|
final List timetable;
|
||||||
ClassTimetable({required this.timetable});
|
ClassTimetable({required this.timetable});
|
||||||
factory ClassTimetable.fromJson(Map<String, dynamic> json) {
|
factory ClassTimetable.fromJson(Map<String, dynamic> json) {
|
||||||
print(json);
|
|
||||||
List<TimetableLesson> lessons = [];
|
List<TimetableLesson> lessons = [];
|
||||||
json['courses'].forEach((value) {
|
json['courses'].forEach((value) {
|
||||||
var name;
|
String subject;
|
||||||
var teacher;
|
String teacher;
|
||||||
var room;
|
String room;
|
||||||
|
String info;
|
||||||
|
Color fontColor;
|
||||||
|
|
||||||
if (value['Fa'].runtimeType != String) {
|
if (value['Fa'].runtimeType != String) {
|
||||||
name = value['Fa']['#text'];
|
subject = value['Fa']['#text'];
|
||||||
} else {
|
} else {
|
||||||
name = value['Fa'];
|
subject = value['Fa'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value['Le'].runtimeType != String) {
|
if (value['Le'].runtimeType != String) {
|
||||||
teacher = value['Le']['#text'];
|
teacher = value['Le']['#text'];
|
||||||
} else {
|
} else {
|
||||||
teacher = value['Le'];
|
teacher = value['Le'];
|
||||||
}
|
}
|
||||||
print(value['Ra']);
|
|
||||||
if (value['Ra'].runtimeType != String && value['Ra'].runtimeType != int) {
|
if (value['Ra'].runtimeType != String && value['Ra'].runtimeType != int) {
|
||||||
if (value['Ra']['#text'] == ' ') {
|
if (value['Ra']['#text'] == ' ' || value['Ra']['#text'] == null) {
|
||||||
room = '';
|
|
||||||
} else if (value['Ra']['#text'] == null) {
|
|
||||||
room = '';
|
room = '';
|
||||||
} else {
|
} else {
|
||||||
room = value['Ra']['#text'];
|
room = value['Ra']['#text'].toString();
|
||||||
}
|
}
|
||||||
} else if (value['Ra'] == ' ') {
|
} else if (value['Ra'] == ' ') {
|
||||||
room = '';
|
room = '';
|
||||||
} else {
|
} else {
|
||||||
room = value['Ra'];
|
room = value['Ra'].toString();
|
||||||
}
|
}
|
||||||
Color fontColor;
|
|
||||||
if (name == '---') {
|
if (subject == '---') {
|
||||||
fontColor = Colors.red;
|
fontColor = Colors.red;
|
||||||
} else {
|
} else {
|
||||||
fontColor = Colors.white;
|
fontColor = Colors.white;
|
||||||
}
|
}
|
||||||
var info;
|
|
||||||
if (value['If'].runtimeType != String) {
|
if (value['If'].runtimeType != String) {
|
||||||
info = '';
|
info = '';
|
||||||
} else {
|
} else {
|
||||||
info = value['If'];
|
info = value['If'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Color> lessonColor = buildLessonColor(name);
|
Future<Color> lessonColor = buildLessonColor(subject);
|
||||||
|
|
||||||
lessons.add(TimetableLesson(
|
lessons.add(TimetableLesson(
|
||||||
value['St'],
|
value['St'],
|
||||||
names[name] ?? name.toString(),
|
subjects[subject] ?? subject.toString(),
|
||||||
teachers[teacher] ?? teacher.toString(),
|
teachers[teacher] ?? teacher.toString(),
|
||||||
room.toString(),
|
room.toString(),
|
||||||
value['If'].toString(),
|
value['If'].toString(),
|
||||||
|
@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 0.7.5-beta1.nightly2021-11-04
|
version: 0.7.5-beta1.nightly2021-11-16
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.12.0 <3.0.0"
|
sdk: ">=2.12.0 <3.0.0"
|
||||||
@ -36,10 +36,10 @@ dependencies:
|
|||||||
http: ^0.13.3
|
http: ^0.13.3
|
||||||
google_fonts: ^2.1.0
|
google_fonts: ^2.1.0
|
||||||
time: ^2.0.0
|
time: ^2.0.0
|
||||||
flutter_launcher_icons: "^0.9.1"
|
flutter_launcher_icons: ^0.9.1
|
||||||
fluttertoast: ^8.0.8
|
fluttertoast: ^8.0.8
|
||||||
flutter_colorpicker: ^0.6.0
|
flutter_colorpicker: ^0.6.0
|
||||||
material_design_icons_flutter: 5.0.5955-rc.1
|
material_design_icons_flutter: ^5.0.5955-rc.1
|
||||||
cyclop: ^0.5.2
|
cyclop: ^0.5.2
|
||||||
|
|
||||||
flutter_icons:
|
flutter_icons:
|
||||||
|
Reference in New Issue
Block a user