Skip to content

Commit

Permalink
versrion 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dariowskii committed Nov 8, 2020
1 parent 0cb34f9 commit f768810
Show file tree
Hide file tree
Showing 15 changed files with 1,835 additions and 701 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

Expand Down
15 changes: 6 additions & 9 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void backgroundFetchLibretto(String taskId) async {
AwesomeNotifications().createNotification(
content: NotificationContent(
color: kMainColor_darker,
notificationLayout: NotificationLayout.BigText,
backgroundColor: Colors.white,
id: 1,
channelKey: 'libretto',
Expand All @@ -41,12 +42,11 @@ void backgroundFetchTasse(String taskId) async {
if (tasse["da_pagare"] > tasseDaPagare) {
AwesomeNotifications().createNotification(
content: NotificationContent(
color: kMainColor_darker,
backgroundColor: Colors.white,
id: 1,
notificationLayout: NotificationLayout.BigText,
id: 2,
channelKey: 'tasse',
title: 'Nuove tasse!',
body: "Potrebbero esserci nuove tasse da pagare, dai un'occhiata"),
body: "Potrebbero esserci nuove tasse da pagare, dai un'occhiata."),
);
}
}
Expand All @@ -60,8 +60,6 @@ Future<void> main() async {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
SharedPreferences prefs = await SharedPreferences.getInstance();
var status = prefs.getBool('isLoggedIn') ?? false;
BackgroundFetch.registerHeadlessTask(backgroundFetchTasse);
BackgroundFetch.registerHeadlessTask(backgroundFetchLibretto);
AwesomeNotifications().setChannel(NotificationChannel(
importance: NotificationImportance.Max,
channelKey: 'tasse',
Expand Down Expand Up @@ -109,9 +107,8 @@ class _MyAppState extends State<MyApp> {
// Configure BackgroundFetch.
BackgroundFetch.configure(
BackgroundFetchConfig(
minimumFetchInterval: 1440,
stopOnTerminate: false,
enableHeadless: true,
startOnBoot: true,
minimumFetchInterval: 15,
requiresBatteryNotLow: true,
requiresCharging: false,
requiresStorageNotLow: false,
Expand Down
177 changes: 0 additions & 177 deletions lib/screens/appelli_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,132 +4,6 @@ import 'package:flutter/material.dart';

import '../constants.dart';

// class AppelliPage extends StatefulWidget {
// @override
// _AppelliPageState createState() => _AppelliPageState();
// }
//
// class _AppelliPageState extends State<AppelliPage> {
// Future _appelli;
//
// @override
// void initState() {
// // TODO: implement initState
// super.initState();
//
// _appelli = Provider.getAppelli();
// }
//
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// appBar: AppBar(
// leading: IconButton(
// icon: Icon(Icons.arrow_back),
// onPressed: () {
// Navigator.of(context).pop();
// }),
// title: Text("Prossimi appelli"),
// ),
// body: FutureBuilder(
// future: _appelli,
// builder: (context, appelli) {
// switch (appelli.connectionState) {
// case ConnectionState.none:
// return Padding(
// padding: EdgeInsets.all(32.0),
// child: Center(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Image(
// width: 200,
// image: AssetImage('assets/img/conn_problem.png'),
// ),
// SizedBox(
// height: 20,
// ),
// Text(
// "Oops..",
// style: TextStyle(
// fontWeight: FontWeight.bold, fontSize: 32),
// ),
// SizedBox(height: 10),
// Text(
// "Ci sono problemi nel recuperare i tuoi dati, aggiorna oppure riprova tra un pò!",
// softWrap: true,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 20,
// ),
// )
// ],
// ),
// ),
// );
// case ConnectionState.waiting:
// return Center(
// child: CircularProgressIndicator(
// valueColor: AlwaysStoppedAnimation<Color>(kMainColor_darker),
// ),
// );
// case ConnectionState.active:
// case ConnectionState.done:
// if (appelli.data["success"] && appelli.data["totali"] == 0)
// return Padding(
// padding: EdgeInsets.all(32.0),
// child: Center(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Image(
// width: 200,
// image: AssetImage('assets/img/no_results.png'),
// ),
// SizedBox(
// height: 20,
// ),
// Text(
// "Sembra non ci siano appelli al momento!",
// softWrap: true,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 25,
// ),
// )
// ],
// ),
// ),
// );
// return ListView.builder(
// padding: EdgeInsets.all(24),
// itemCount: appelli.data["totali"],
// itemBuilder: (context, index) {
// return CardAppello(
// nomeMateria: appelli.data["materia"][index],
// dataAppello: appelli.data["data_appello"][index],
// desc: appelli.data["desc"][index],
// periodoIscrizioni: appelli.data["periodo_iscrizione"]
// [index],
// sessione: appelli.data["sessione"][index],
// urlInfo: appelli.data["link_info"][index],
// );
// },
// );
// default:
// return Text("Errore FutureBuilder appelli");
// }
// },
// ),
// );
// }
// }
class AppelliPage extends StatefulWidget {
@override
_AppelliPageState createState() => _AppelliPageState();
Expand Down Expand Up @@ -247,40 +121,6 @@ class _AppelliPageState extends State<AppelliPage> {
)
],
);
// return Padding(
// padding: EdgeInsets.all(32.0),
// child: Center(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Image(
// width: 200,
// image: AssetImage('assets/img/conn_problem.png'),
// ),
// SizedBox(
// height: 20,
// ),
// Text(
// "Oops..",
// style: TextStyle(
// fontWeight: FontWeight.bold, fontSize: 32),
// ),
// SizedBox(height: 10),
// Text(
// "Ci sono problemi nel recuperare i tuoi dati, aggiorna oppure riprova tra un pò!",
// softWrap: true,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 20,
// ),
// )
// ],
// ),
// ),
// );
case ConnectionState.waiting:
return CustomScrollView(
physics: ClampingScrollPhysics(),
Expand Down Expand Up @@ -360,23 +200,6 @@ class _AppelliPageState extends State<AppelliPage> {
))
],
);
// return Center(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// CircularProgressIndicator(
// valueColor:
// AlwaysStoppedAnimation<Color>(kMainColor_darker),
// ),
// const SizedBox(height: 15),
// Text(
// "Solo un secondo...",
// style: const TextStyle(
// color: Color(0xffFF5800), fontSize: 16),
// )
// ],
// ),
// );
case ConnectionState.active:
case ConnectionState.done:
if (appelli.data["success"] && appelli.data["totali"] == 0)
Expand Down
Loading

0 comments on commit f768810

Please sign in to comment.