Skip to content

Commit

Permalink
Leermiddelen nu uitgevers en vak
Browse files Browse the repository at this point in the history
  • Loading branch information
Guusvanmeerveld committed Nov 23, 2020
1 parent 65642b5 commit ea71c75
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 24 deletions.
24 changes: 24 additions & 0 deletions lib/src/ui/CustomWidgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import 'package:Argo/main.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:url_launcher/url_launcher.dart';

import 'package:clipboard/clipboard.dart';
import 'package:fluttertoast/fluttertoast.dart';

BorderSide greyBorderSide() {
Color color;
if (theme == Brightness.dark) {
Expand Down Expand Up @@ -50,6 +53,27 @@ class ShowPeopleList extends StatelessWidget {
title,
),
actions: [
IconButton(
tooltip: "Kopieer lijst",
icon: Icon(
Icons.copy,
),
onPressed: () {
FlutterClipboard.copy(
people.join(" \r\n"),
).then((value) => {
Fluttertoast.showToast(
msg: "Gekopieerd ;)",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.white,
textColor: Colors.black,
fontSize: 16.0,
),
});
},
),
Padding(
padding: EdgeInsets.only(
right: 5,
Expand Down
25 changes: 20 additions & 5 deletions lib/src/ui/tabs/Leermiddelen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,27 @@ class _Leermiddelen extends State<Leermiddelen> {
children: [
for (Leermiddel leermiddel in account.leermiddelen)
SeeCard(
child: ListTileBorder(
onTap: () => account.magister.leermiddelen.launch(leermiddel),
border: Border(
bottom: greyBorderSide(),
child: Tooltip(
message: leermiddel.title,
child: ListTileBorder(
onTap: () => account.magister.leermiddelen.launch(leermiddel),
border: Border(
bottom: greyBorderSide(),
),
title: Text(
leermiddel.title,
overflow: TextOverflow.ellipsis,
),
subtitle: Text(
leermiddel?.uitgeverij,
),
trailing: Text(
leermiddel?.vak?.code ?? "",
style: TextStyle(
fontSize: 16,
),
),
),
title: Text(leermiddel.title),
),
),
],
Expand Down
9 changes: 9 additions & 0 deletions lib/src/utils/hive/adapters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,11 @@ class Vak {
String naam;
@HiveField(1)
int id;
@HiveField(2)
String code;
Vak([vak]) {
if (vak != null) {
this.code = vak["Afkorting"];
this.id = vak["Id"];
this.naam = ((vak["Omschrijving"] ?? vak["omschrijving"] ?? vak["Naam"] ?? "leeg") as String).cap;
}
Expand Down Expand Up @@ -436,8 +439,14 @@ class Leermiddel {
String title;
@HiveField(1)
String ean;
@HiveField(2)
String uitgeverij;
@HiveField(3)
Vak vak;
Leermiddel([leermiddel]) {
if (leermiddel != null) {
this.uitgeverij = leermiddel["Uitgeverij"];
this.vak = Vak(leermiddel["Vak"]);
this.title = leermiddel["Titel"];
this.ean = leermiddel["EAN"];
}
Expand Down
97 changes: 78 additions & 19 deletions lib/src/utils/hive/adapters.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ dependencies:
timer_builder: ^1.3.0
flutter_local_notifications: ^3.0.1+4
# get_version: ^0.2.2
clipboard: ^0.1.2+8
fluttertoast: ^7.1.4

dev_dependencies:
flutter_native_splash: ^0.1.9
Expand Down

0 comments on commit ea71c75

Please sign in to comment.