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"
|
||||||
|
}
|
||||||
@@ -2,36 +2,29 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
|
|
||||||
<string>ca-app-pub-3940256099942544/2934735716</string>
|
|
||||||
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
|
|
||||||
<string>ca-app-pub-3940256099942544/4411468910</string>
|
|
||||||
<key>CLIENT_ID</key>
|
|
||||||
<string>test-do-not-use.apps.googleusercontent.com</string>
|
|
||||||
<key>REVERSED_CLIENT_ID</key>
|
|
||||||
<string>com.googleusercontent.apps.test-do-not-use</string>
|
|
||||||
<key>API_KEY</key>
|
<key>API_KEY</key>
|
||||||
<string>000000000000000000000000000000000000000</string>
|
<string>AIzaSyB7BuSBQ9CHuM5C9HalgpOkGf8ZKr70H8M</string>
|
||||||
<key>GCM_SENDER_ID</key>
|
<key>GCM_SENDER_ID</key>
|
||||||
<string>999999999999</string>
|
<string>1079915493414</string>
|
||||||
<key>PLIST_VERSION</key>
|
<key>PLIST_VERSION</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>BUNDLE_ID</key>
|
<key>BUNDLE_ID</key>
|
||||||
<string>com.google.example.BannerExample</string>
|
<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>
|
<key>IS_ADS_ENABLED</key>
|
||||||
<true/>
|
<false></false>
|
||||||
<key>IS_ANALYTICS_ENABLED</key>
|
<key>IS_ANALYTICS_ENABLED</key>
|
||||||
<false/>
|
<false></false>
|
||||||
<key>IS_APPINVITE_ENABLED</key>
|
<key>IS_APPINVITE_ENABLED</key>
|
||||||
<false/>
|
<true></true>
|
||||||
<key>IS_GCM_ENABLED</key>
|
<key>IS_GCM_ENABLED</key>
|
||||||
<true/>
|
<true></true>
|
||||||
<key>IS_SIGNIN_ENABLED</key>
|
<key>IS_SIGNIN_ENABLED</key>
|
||||||
<true/>
|
<true></true>
|
||||||
<key>GOOGLE_APP_ID</key>
|
<key>GOOGLE_APP_ID</key>
|
||||||
<string>1:999999999999:ios:0000000000000000</string>
|
<string>1:1079915493414:ios:3f77c278459dca655d8ee7</string>
|
||||||
<key>DATABASE_URL</key>
|
|
||||||
<string>https://test-do-not-use.firebaseio.com</string>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</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 'package:flutter/material.dart';
|
||||||
|
import '../database/controller.dart';
|
||||||
|
import '../model/promemoria.dart';
|
||||||
|
import '../navigation.dart';
|
||||||
|
|
||||||
class QuickReminder extends StatefulWidget {
|
class QuickReminder extends StatefulWidget {
|
||||||
const QuickReminder({super.key});
|
const QuickReminder({super.key});
|
||||||
@@ -8,18 +11,34 @@ class QuickReminder extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _QuickReminderState extends State<QuickReminder> {
|
class _QuickReminderState extends State<QuickReminder> {
|
||||||
|
Controller controller = Controller();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const ListTile(
|
return ListTile(
|
||||||
leading: Checkbox(
|
leading: const Checkbox(
|
||||||
value: false,
|
value: false,
|
||||||
onChanged: null,
|
onChanged: null,
|
||||||
),
|
),
|
||||||
title: TextField(
|
title: TextField(
|
||||||
decoration: InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'New Reminder',
|
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,
|
onChanged: _onChanged,
|
||||||
),
|
),
|
||||||
title: Text(widget.promemoria?.getTitle() ?? 'Nessun titolo'),
|
title: Text(widget.promemoria?.getTitle() ?? 'Nessun titolo'),
|
||||||
subtitle: Text(DateTime.now().toString()),
|
subtitle: Text(widget.promemoria!.getExpirationDate().toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'base_entity.dart';
|
|
||||||
import 'identifiers/enum/color.dart';
|
import 'identifiers/enum/color.dart';
|
||||||
import 'identifiers/enum/priority.dart';
|
import 'identifiers/enum/priority.dart';
|
||||||
|
|
||||||
@@ -6,14 +5,14 @@ const String promemoriaTable = 'promemoria';
|
|||||||
|
|
||||||
class Promemoria {
|
class Promemoria {
|
||||||
String id = '';
|
String id = '';
|
||||||
String title;
|
String title = '';
|
||||||
String creationDate;
|
String creationDate = '';
|
||||||
String lastModificationDate;
|
String lastModificationDate = '';
|
||||||
String expirationDate;
|
String expirationDate = '';
|
||||||
String? arrayPromemoria;
|
String? arrayPromemoria = '';
|
||||||
String description;
|
String description = '';
|
||||||
String priority;
|
String priority = '';
|
||||||
String color;
|
String color = '';
|
||||||
|
|
||||||
Promemoria(
|
Promemoria(
|
||||||
this.id,
|
this.id,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
|||||||
import '../Components/Reminder.dart';
|
import '../Components/Reminder.dart';
|
||||||
import '../Components/QuickReminder.dart';
|
import '../Components/QuickReminder.dart';
|
||||||
import '../model/promemoria.dart';
|
import '../model/promemoria.dart';
|
||||||
|
import '../database/controller.dart';
|
||||||
|
|
||||||
class TodayView extends StatefulWidget {
|
class TodayView extends StatefulWidget {
|
||||||
const TodayView({super.key});
|
const TodayView({super.key});
|
||||||
@@ -14,14 +15,30 @@ class TodayView extends StatefulWidget {
|
|||||||
|
|
||||||
class _TodayViewState extends State<TodayView> {
|
class _TodayViewState extends State<TodayView> {
|
||||||
|
|
||||||
|
Controller controller = Controller();
|
||||||
|
|
||||||
var _selectedDate = DateTime.now();
|
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("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"),
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -29,31 +46,32 @@ class _TodayViewState extends State<TodayView> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: FilledButton(
|
title: FilledButton(
|
||||||
onPressed: () async {
|
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) {
|
if (newDate != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selectedDate = newDate;
|
_selectedDate = newDate;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(_selectedDate.day.toString() + "/" + _selectedDate.month.toString() + "/" + _selectedDate.year.toString())
|
child: Text("${_selectedDate.day}/${_selectedDate.month}/${_selectedDate.year}")
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body:
|
||||||
children: [
|
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: listaPromemoria?.length,
|
itemCount: (listaPromemoria!.length + 1),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return Reminder(
|
if (index == listaPromemoria.length) {
|
||||||
listaPromemoria?[index]
|
return QuickReminder();
|
||||||
);
|
} else {
|
||||||
|
return Reminder(listaPromemoria[index]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
QuickReminder(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user