-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MatteoGalletta/voti-scrutinio
Aggiunta Voti Scrutinio
- Loading branch information
Showing
7 changed files
with
155 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"background_fetch","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\background_fetch-0.4.0\\\\","dependencies":[]},{"name":"flutter_local_notifications","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_local_notifications-1.4.0\\\\","dependencies":[]},{"name":"fluttertoast","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-4.0.1\\\\","dependencies":[]},{"name":"install_plugin","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\install_plugin-2.0.1\\\\","dependencies":[]},{"name":"package_info","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\package_info-0.4.0+16\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.5\\\\","dependencies":[]},{"name":"quick_actions","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\quick_actions-0.4.0+2\\\\","dependencies":[]},{"name":"url_launcher","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher-5.4.2\\\\","dependencies":[]}],"android":[{"name":"background_fetch","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\background_fetch-0.4.0\\\\","dependencies":[]},{"name":"flutter_local_notifications","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_local_notifications-1.4.0\\\\","dependencies":[]},{"name":"fluttertoast","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-4.0.1\\\\","dependencies":[]},{"name":"install_plugin","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\install_plugin-2.0.1\\\\","dependencies":[]},{"name":"package_info","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\package_info-0.4.0+16\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.5\\\\","dependencies":[]},{"name":"quick_actions","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\quick_actions-0.4.0+2\\\\","dependencies":[]},{"name":"url_launcher","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher-5.4.2\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_macos-0.0.1+2\\\\","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"fluttertoast","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-4.0.1\\\\","dependencies":[]},{"name":"url_launcher_web","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_web-0.1.0+2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"background_fetch","dependencies":[]},{"name":"flutter_local_notifications","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"install_plugin","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"quick_actions","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2021-03-13 19:21:35.468884","version":"2.0.1"} | ||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"background_fetch","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\background_fetch-0.4.0\\\\","dependencies":[]},{"name":"flutter_local_notifications","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_local_notifications-1.4.0\\\\","dependencies":[]},{"name":"fluttertoast","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-4.0.1\\\\","dependencies":[]},{"name":"install_plugin","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\install_plugin-2.0.1\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\package_info-0.4.0+16\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.5\\\\","dependencies":[]},{"name":"quick_actions","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\quick_actions-0.4.0+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher-5.4.2\\\\","dependencies":[]}],"android":[{"name":"background_fetch","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\background_fetch-0.4.0\\\\","dependencies":[]},{"name":"flutter_local_notifications","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_local_notifications-1.4.0\\\\","dependencies":[]},{"name":"fluttertoast","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-4.0.1\\\\","dependencies":[]},{"name":"install_plugin","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\install_plugin-2.0.1\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\package_info-0.4.0+16\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.5\\\\","dependencies":[]},{"name":"quick_actions","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\quick_actions-0.4.0+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher-5.4.2\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_macos-0.0.1+2\\\\","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"fluttertoast","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-4.0.1\\\\","dependencies":[]},{"name":"url_launcher_web","path":"D:\\\\Flutter SDK\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_web-0.1.0+2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"background_fetch","dependencies":[]},{"name":"flutter_local_notifications","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"install_plugin","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"quick_actions","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2021-08-29 01:18:36.554890","version":"2.2.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import 'package:argo_famiglia/widgets.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:backdrop/backdrop.dart'; | ||
import 'dart:async'; | ||
import 'backdropWidgets.dart'; | ||
import 'api.dart'; | ||
import 'database.dart'; | ||
|
||
class ScrutinioRoute extends StatefulWidget { | ||
@override | ||
State<StatefulWidget> createState() { | ||
return _ScrutinioRouteState(); | ||
} | ||
} | ||
|
||
class _ScrutinioRouteState extends State<ScrutinioRoute> { | ||
var voti = {}; | ||
final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = | ||
new GlobalKey<RefreshIndicatorState>(); | ||
|
||
generaLista() { | ||
var tiles = <Widget>[]; | ||
voti.forEach((final idPeriodo, var periodoScrutinio) { | ||
|
||
var votiScrutinio = <Widget>[]; | ||
print("periodoScrutinio => " + periodoScrutinio.toString()); | ||
for (var voto in periodoScrutinio['dati']) { | ||
votiScrutinio.add(widgetScrutinio(voto, context)); | ||
} | ||
|
||
tiles.add(ExpansionTile( | ||
title: Text(periodoScrutinio['titolo']), | ||
children: votiScrutinio.isNotEmpty ? votiScrutinio : [new Text("Nessun voto")] | ||
) | ||
); | ||
|
||
}); | ||
|
||
return tiles; | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
|
||
var lista = generaLista(); | ||
|
||
return BackdropScaffold( | ||
title: Text('Voti Scrutinio'), | ||
backLayer: getBackdrop(context), | ||
frontLayer: RefreshIndicator( | ||
key: _refreshIndicatorKey, | ||
onRefresh: aggiornaVoti, | ||
child: ListView( | ||
children: new List.from(<Widget>[])..addAll(lista) | ||
) | ||
) | ||
); | ||
} | ||
|
||
Future aggiornaVoti() async { | ||
var nuoviVoti = await votiscruitinio(); | ||
|
||
if (nuoviVoti.isNotEmpty) { | ||
await Database.put('votiscrutinio', nuoviVoti); | ||
} | ||
|
||
setState(() { | ||
voti = nuoviVoti; | ||
}); | ||
} | ||
|
||
|
||
void initState() { | ||
super.initState(); | ||
WidgetsBinding.instance | ||
.addPostFrameCallback((_) => _refreshIndicatorKey.currentState.show()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters