bo non lo so
This commit is contained in:
29
android/app/google-services.json
Normal file
29
android/app/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "1079915493414",
|
||||
"project_id": "progetto-m335-a4126",
|
||||
"storage_bucket": "progetto-m335-a4126.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:1079915493414:android:1af31a3970a27c5c5d8ee7",
|
||||
"android_client_info": {
|
||||
"package_name": "ch.ameti.progetto_m335_flutter"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDANiNzXOXgtVKheZnTw7TCw40AFyIznGg"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
30
ios/Runner/GoogleService-Info.plist
Normal file
30
ios/Runner/GoogleService-Info.plist
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyB7BuSBQ9CHuM5C9HalgpOkGf8ZKr70H8M</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>1079915493414</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>io.flutter.flutter.app</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>progetto-m335-a4126</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>progetto-m335-a4126.appspot.com</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:1079915493414:ios:3f77c278459dca655d8ee7</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,17 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../pages/EditReminder.dart';
|
||||
|
||||
class EditReminderButton extends StatelessWidget{
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FilledButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => EditReminder()),
|
||||
);
|
||||
},
|
||||
child: Icon(Icons.list),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../database/controller.dart';
|
||||
import '../model/promemoria.dart';
|
||||
import '../navigation.dart';
|
||||
|
||||
class QuickReminder extends StatefulWidget {
|
||||
const QuickReminder({super.key});
|
||||
@@ -8,18 +11,34 @@ class QuickReminder extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _QuickReminderState extends State<QuickReminder> {
|
||||
Controller controller = Controller();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const ListTile(
|
||||
leading: Checkbox(
|
||||
return ListTile(
|
||||
leading: const Checkbox(
|
||||
value: false,
|
||||
onChanged: null,
|
||||
),
|
||||
title: TextField(
|
||||
decoration: InputDecoration(
|
||||
labelText: 'New Reminder',
|
||||
),
|
||||
),
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'New Reminder',
|
||||
),
|
||||
onSubmitted: (String value) {
|
||||
controller.addPromemoria(Promemoria.today(
|
||||
value,
|
||||
DateTime.now().toString(),
|
||||
DateTime.now().toString(),
|
||||
DateTime.now().toString(),
|
||||
"description"));
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
PageRouteBuilder(pageBuilder: (context, animation1, animation2) {
|
||||
return Navigation();
|
||||
},
|
||||
transitionDuration: const Duration(seconds: 0)),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class _ReminderState extends State<Reminder> {
|
||||
onChanged: _onChanged,
|
||||
),
|
||||
title: Text(widget.promemoria?.getTitle() ?? 'Nessun titolo'),
|
||||
subtitle: Text(DateTime.now().toString()),
|
||||
subtitle: Text(widget.promemoria!.getExpirationDate().toString()),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
||||
@@ -5,14 +5,14 @@ const String promemoriaTable = 'promemoria';
|
||||
|
||||
class Promemoria {
|
||||
String id = '';
|
||||
String title;
|
||||
String creationDate;
|
||||
String lastModificationDate;
|
||||
String expirationDate;
|
||||
String? arrayPromemoria;
|
||||
String description;
|
||||
String priority;
|
||||
String color;
|
||||
String title = '';
|
||||
String creationDate = '';
|
||||
String lastModificationDate = '';
|
||||
String expirationDate = '';
|
||||
String? arrayPromemoria = '';
|
||||
String description = '';
|
||||
String priority = '';
|
||||
String color = '';
|
||||
|
||||
Promemoria(
|
||||
this.id,
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import '../Components/Reminder.dart';
|
||||
import '../Components/QuickReminder.dart';
|
||||
import '../model/promemoria.dart';
|
||||
import '../database/controller.dart';
|
||||
|
||||
class TodayView extends StatefulWidget {
|
||||
const TodayView({super.key});
|
||||
@@ -14,14 +15,30 @@ class TodayView extends StatefulWidget {
|
||||
|
||||
class _TodayViewState extends State<TodayView> {
|
||||
|
||||
Controller controller = Controller();
|
||||
|
||||
var _selectedDate = DateTime.now();
|
||||
|
||||
List<Promemoria> listaPromemoria = [
|
||||
List<Promemoria> listaPromemoria = [];
|
||||
|
||||
/*[
|
||||
Promemoria.today("Primo promemoria", DateTime.now().toString(), DateTime.now().toString(), DateTime.now().toString(), "Descrizione primo promemoria"),
|
||||
Promemoria.today("Secondo promemoria", DateTime.now().toString(), DateTime.now().toString(), DateTime.now().toString(), "Descrizione secondo promemoria"),
|
||||
];
|
||||
];*/
|
||||
|
||||
getAllPromemoria() async {
|
||||
List<Promemoria> temp = await controller.getAllPromemoria();
|
||||
setState(() {
|
||||
listaPromemoria = temp;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
getAllPromemoria();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -29,30 +46,31 @@ class _TodayViewState extends State<TodayView> {
|
||||
appBar: AppBar(
|
||||
title: FilledButton(
|
||||
onPressed: () async {
|
||||
DateTime? newDate = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: DateTime(1), lastDate: DateTime(9999));
|
||||
DateTime? newDate = await showDatePicker(context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(1),
|
||||
lastDate: DateTime(9999));
|
||||
if (newDate != null) {
|
||||
setState(() {
|
||||
_selectedDate = newDate;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Text(_selectedDate.day.toString() + "/" + _selectedDate.month.toString() + "/" + _selectedDate.year.toString())
|
||||
child: Text("${_selectedDate.day}/${_selectedDate.month}/${_selectedDate.year}")
|
||||
),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
itemCount: listaPromemoria?.length,
|
||||
itemBuilder: (BuildContext context, int index){
|
||||
return Reminder(
|
||||
listaPromemoria?[index]
|
||||
);
|
||||
},
|
||||
),
|
||||
QuickReminder(),
|
||||
],
|
||||
body:
|
||||
ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
itemCount: (listaPromemoria!.length + 1),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
if (index == listaPromemoria.length) {
|
||||
return QuickReminder();
|
||||
} else {
|
||||
return Reminder(listaPromemoria[index]);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user