Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51f964833e |
@@ -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,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../Components/EditReminderButton.dart';
|
||||
import '../model/promemoria.dart';
|
||||
import '../pages/EditReminder.dart';
|
||||
|
||||
@@ -21,8 +20,6 @@ class _ReminderState extends State<Reminder> {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
@@ -35,7 +32,7 @@ class _ReminderState extends State<Reminder> {
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => EditReminder()),
|
||||
MaterialPageRoute(builder: (context) => EditReminder(widget.promemoria)),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
abstract class BaseEntity{
|
||||
static String id = 'id';
|
||||
static String title = 'Title';
|
||||
static String creationDate = 'CreationDate';
|
||||
static String lastEditDate = 'LastEditDate';
|
||||
|
||||
static String get getId{
|
||||
return id;
|
||||
}
|
||||
static String get getTitle{
|
||||
return title;
|
||||
}
|
||||
static String get getCreationDate{
|
||||
return creationDate;
|
||||
}
|
||||
static String get getLastEditDate{
|
||||
return lastEditDate;
|
||||
}
|
||||
String id = 'id';
|
||||
String title = 'Title';
|
||||
String creationDate = 'CreationDate';
|
||||
String lastEditDate = 'LastEditDate';
|
||||
|
||||
BaseEntity();
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class Promemoria extends BaseEntity {
|
||||
|
||||
static Color color = Color.none;
|
||||
|
||||
Promemoria(String description){
|
||||
Promemoria(String description) : super(){
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../model/promemoria.dart';
|
||||
|
||||
class EditReminder extends StatefulWidget {
|
||||
const EditReminder({super.key});
|
||||
final Promemoria? promemoria;
|
||||
const EditReminder(this.promemoria, {super.key});
|
||||
|
||||
@override
|
||||
State<EditReminder> createState() => _EditReminderState();
|
||||
@@ -28,7 +30,7 @@ class _EditReminderState extends State<EditReminder> {
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
TextField(
|
||||
controller: TextEditingController(text: _title),
|
||||
controller: TextEditingController(text: widget.promemoria?.description ?? ""),
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Title',
|
||||
|
||||
@@ -20,10 +20,11 @@ class _TodayViewState extends State<TodayView> {
|
||||
new Promemoria("Primo promemoria"),
|
||||
new Promemoria("Secondo promemoria"),
|
||||
new Promemoria("Terzo promemoria"),
|
||||
new Promemoria("Quarto promemoria"),
|
||||
new Promemoria("Quinto promemoria"),
|
||||
new Promemoria("Sesto promemoria"),
|
||||
];
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
||||
Reference in New Issue
Block a user