-
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 #19 from MatteoGalletta/logout
- Aggiunto pulsante Logout in Impostazioni - Aggiunta schermata vari anagrafici - Aggiunta schermata voti scrutinio - Fix vari
- Loading branch information
Showing
13 changed files
with
305 additions
and
26 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":"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":"restart_app","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\restart_app-1.0.3\\\\","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":"restart_app","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2021-09-09 10:05:29.896674","version":"2.0.1"} |
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,87 @@ | ||
import 'package:backdrop/backdrop.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'backdropWidgets.dart'; | ||
import 'database.dart'; | ||
|
||
class DatiAnagraficiRoute extends StatefulWidget { | ||
@override | ||
State<StatefulWidget> createState() { | ||
return _DatiAnagraficiRouteState(); | ||
} | ||
} | ||
|
||
class _DatiAnagraficiRouteState extends State<DatiAnagraficiRoute> { | ||
var dati = {}; | ||
final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = | ||
new GlobalKey<RefreshIndicatorState>(); | ||
|
||
List<TextSpan> createLines(List<Map<String, String>> elements) { | ||
|
||
var labelStyle = new TextStyle(color: Theme.of(context).textTheme.bodyText2.color.withOpacity(0.5)); | ||
var valueStyle = new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, color: Theme.of(context).textTheme.bodyText2.color); | ||
|
||
return elements.map((e) => [ | ||
new TextSpan(text: e['label'], style: labelStyle), | ||
new TextSpan(text: e['value'] ?? '', style: valueStyle), | ||
new TextSpan(text: '\n') | ||
]).expand((e) => e).toList(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
|
||
var text = dati == null | ||
? <TextSpan>[] | ||
: createLines([ | ||
{'label': 'Nome: ', 'value': dati['desNome']}, | ||
{'label': 'Cognome: ', 'value': dati['desCognome']}, | ||
{'label': 'Sesso: ', 'value': dati['flgSesso'] == 'M' ? 'Maschio' : 'Femmina'}, | ||
{'label': 'Cittadinanza: ', 'value': dati['desCittadinanza']}, | ||
{'label': 'Codice Fiscale: ', 'value': dati['desCf']}, | ||
{'label': 'Telefono: ', 'value': dati['desTelefono']}, | ||
{'label': 'Cellulare: ', 'value': dati['desCellulare']}, | ||
{'label': 'Data di Nascita: ', 'value': dati['datNascita']}, // List.from(dati['datNascita'].split('-').reversed).join('-') | ||
{'label': 'Comune di Nascita: ', 'value': dati['desComuneNascita']}, | ||
{'label': 'CAP di Nascita: ', 'value': dati['desCap']}, | ||
{'label': 'Comune di Residenza: ', 'value': dati['desComuneResidenza']}, | ||
{'label': 'CAP di Residenza: ', 'value': dati['desCapResidenza']}, | ||
{'label': 'Comune di Recapito: ', 'value': dati['desComuneRecapito']}, | ||
{'label': 'Indirizzo di Recapito: ', 'value': dati['desIndirizzoRecapito']}, | ||
// {'label': '??: ', 'value': dati['desVia']} | ||
]); | ||
|
||
return BackdropScaffold( | ||
title: Text('Dati Anagrafici'), | ||
backLayer: getBackdrop(context), | ||
frontLayer: RefreshIndicator( | ||
key: _refreshIndicatorKey, | ||
onRefresh: aggiornaDatiAnagrafici, | ||
child: Container( | ||
margin: const EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0), | ||
child: new RichText( | ||
text: new TextSpan( | ||
style: new TextStyle( | ||
height: 1.6 | ||
), | ||
children: text, | ||
), | ||
) | ||
) | ||
) | ||
); | ||
} | ||
|
||
Future aggiornaDatiAnagrafici() async { | ||
var nuoviDati = await Database.get('dati-anagrafici'); | ||
setState(() { | ||
dati = nuoviDati; | ||
}); | ||
} | ||
|
||
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
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,65 @@ | ||
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'; | ||
|
||
class ScrutinioRoute extends StatefulWidget { | ||
@override | ||
State<StatefulWidget> createState() { | ||
return _ScrutinioRouteState(); | ||
} | ||
} | ||
|
||
class _ScrutinioRouteState extends State<ScrutinioRoute> { | ||
var scrutinio = {}; | ||
final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = | ||
new GlobalKey<RefreshIndicatorState>(); | ||
|
||
generaLista() { | ||
var tiles = <Widget>[]; | ||
scrutinio.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: aggiornaScrutinio, | ||
child: | ||
ListView(children: new List.from(<Widget>[])..addAll(lista)))); | ||
} | ||
|
||
Future aggiornaScrutinio() async { | ||
var nuoviVoti = await votiscruitinio(); | ||
setState(() { | ||
scrutinio = nuoviVoti; | ||
}); | ||
} | ||
|
||
void initState() { | ||
super.initState(); | ||
WidgetsBinding.instance | ||
.addPostFrameCallback((_) => _refreshIndicatorKey.currentState.show()); | ||
} | ||
} |
Oops, something went wrong.