grafica quasi finita
This commit is contained in:
25
lib/Components/QuickReminder.dart
Normal file
25
lib/Components/QuickReminder.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class QuickReminder extends StatefulWidget {
|
||||
const QuickReminder({super.key});
|
||||
|
||||
@override
|
||||
State<QuickReminder> createState() => _QuickReminderState();
|
||||
}
|
||||
|
||||
class _QuickReminderState extends State<QuickReminder> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const ListTile(
|
||||
leading: Checkbox(
|
||||
value: false,
|
||||
onChanged: null,
|
||||
),
|
||||
title: TextField(
|
||||
decoration: InputDecoration(
|
||||
labelText: 'New Reminder',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../Components/EditReminderButton.dart';
|
||||
import '../pages/EditReminder.dart';
|
||||
|
||||
class Reminder extends StatefulWidget {
|
||||
const Reminder({super.key});
|
||||
@@ -27,7 +28,12 @@ class _ReminderState extends State<Reminder> {
|
||||
),
|
||||
title: Text("Reminder"),
|
||||
subtitle: Text(DateTime.now().toString()),
|
||||
trailing: EditReminderButton(),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => EditReminder()),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,12 @@ import 'identifiers/enum/priority.dart';
|
||||
const String promemoriaTable = 'promemoria';
|
||||
|
||||
class Promemoria extends BaseEntity {
|
||||
static String id = BaseEntity.getId;
|
||||
static String title = BaseEntity.getTitle;
|
||||
static String creationDate = BaseEntity.getCreationDate;
|
||||
static String lastModificationDate = BaseEntity.getLastEditDate;
|
||||
static String expirationDate = '';
|
||||
static String arrayPromemoria = '';
|
||||
static String description = '';
|
||||
static Priority priority = Priority.none;
|
||||
|
||||
static Color color = Color.none;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ class MyApp extends StatelessWidget {
|
||||
title: 'My App',
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorSchemeSeed: Colors.blue,
|
||||
|
||||
|
||||
),
|
||||
home: Navigation()
|
||||
);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'pages/testUI.dart';
|
||||
import 'pages/TodayView.dart';
|
||||
import 'pages/InboxView.dart';
|
||||
import 'pages/NotesView.dart';
|
||||
import 'pages/test.dart';
|
||||
|
||||
|
||||
class Navigation extends StatefulWidget {
|
||||
const Navigation({super.key});
|
||||
|
||||
@@ -10,7 +10,12 @@ class EditReminder extends StatefulWidget {
|
||||
class _EditReminderState extends State<EditReminder> {
|
||||
String _title = "ciaciao";
|
||||
String _description = "description";
|
||||
DateTime _date = DateTime.now();
|
||||
DateTime? _date;
|
||||
|
||||
//Arraylist of promemoria
|
||||
|
||||
bool _hasDate = true;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -18,37 +23,112 @@ class _EditReminderState extends State<EditReminder> {
|
||||
title: Text("Edit Reminder"),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
TextField(
|
||||
controller: TextEditingController(text: _title),
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Title',
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
TextField(
|
||||
controller: TextEditingController(text: _title),
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Title',
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Expanded(child: TextField(
|
||||
onChanged: (text) {
|
||||
setState(() {
|
||||
_description = text;
|
||||
});
|
||||
},
|
||||
controller: TextEditingController(text: _description),
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Description',
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
TextField(
|
||||
onChanged: (text) {
|
||||
setState(() {
|
||||
_description = text;
|
||||
});
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Description',
|
||||
),
|
||||
maxLines: 6,
|
||||
keyboardType: TextInputType.multiline,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
FilledButton(
|
||||
onPressed: () async {
|
||||
DateTime? newDate = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(1),
|
||||
lastDate: DateTime(9999));
|
||||
if (newDate != null) {
|
||||
setState(() {
|
||||
_date = newDate;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Row(children: [
|
||||
if (_date != null) Text("${_date?.day}/${_date?.month}/${_date?.year}"),
|
||||
//if (_date == null) Text("Add Date"),
|
||||
if (_date != null) const SizedBox(width: 10),
|
||||
const Icon(Icons.calendar_month)
|
||||
])),
|
||||
if (_date != null) IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_date = null;
|
||||
});
|
||||
print("setting _date to ${_date}");
|
||||
},
|
||||
icon: Icon(Icons.close)),
|
||||
if (_date == null) TextButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_date = DateTime.now();
|
||||
});
|
||||
print("setting _date to ${_date}");
|
||||
},
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.add),
|
||||
SizedBox(width: 5),
|
||||
Text("Add Today")
|
||||
],
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FilledButton(
|
||||
onPressed: () {
|
||||
print("ciao");
|
||||
},
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty.all(Colors.red)),
|
||||
child: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.delete),
|
||||
Text("Delete"),
|
||||
],
|
||||
)),
|
||||
),
|
||||
maxLines: 6,
|
||||
keyboardType: TextInputType.multiline,
|
||||
),),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: FilledButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text("Save"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
//import components
|
||||
import '../Components/Reminder.dart';
|
||||
|
||||
class InboxView extends StatefulWidget {
|
||||
const InboxView({super.key});
|
||||
|
||||
@@ -10,9 +13,15 @@ class InboxView extends StatefulWidget {
|
||||
class _InboxViewState extends State<InboxView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Icon(Icons.inbox),
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Inbox'),
|
||||
),
|
||||
body: ListView(
|
||||
children: const <Widget>[
|
||||
Reminder(),
|
||||
Reminder(),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
|
||||
|
||||
//import components
|
||||
import '../Components/Reminder.dart';
|
||||
import '../Components/EditReminderButton.dart';
|
||||
import '../Components/QuickReminder.dart';
|
||||
import '../model/promemoria.dart';
|
||||
|
||||
class TodayView extends StatefulWidget {
|
||||
const TodayView({super.key});
|
||||
@@ -12,13 +13,32 @@ class TodayView extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _TodayViewState extends State<TodayView> {
|
||||
|
||||
var _selectedDate = DateTime.now();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
children: <Widget>[
|
||||
Reminder(),
|
||||
Reminder(),
|
||||
]
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: FilledButton(
|
||||
onPressed: () async {
|
||||
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())
|
||||
),
|
||||
),
|
||||
body: ListView(
|
||||
children: const <Widget>[
|
||||
Reminder(),
|
||||
Reminder(),
|
||||
QuickReminder()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user