listViw builder
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../Components/EditReminderButton.dart';
|
||||
import '../model/promemoria.dart';
|
||||
import '../pages/EditReminder.dart';
|
||||
|
||||
class Reminder extends StatefulWidget {
|
||||
const Reminder({super.key});
|
||||
final Promemoria? promemoria;
|
||||
const Reminder(this.promemoria, {super.key});
|
||||
|
||||
@override
|
||||
State<Reminder> createState() => _ReminderState();
|
||||
@@ -19,6 +21,8 @@ class _ReminderState extends State<Reminder> {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
@@ -26,7 +30,7 @@ class _ReminderState extends State<Reminder> {
|
||||
value: _value,
|
||||
onChanged: _onChanged,
|
||||
),
|
||||
title: Text("Reminder"),
|
||||
title: Text(widget.promemoria?.description ?? 'Nessun titolo'),
|
||||
subtitle: Text(DateTime.now().toString()),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
||||
@@ -7,10 +7,13 @@ const String promemoriaTable = 'promemoria';
|
||||
class Promemoria extends BaseEntity {
|
||||
static String expirationDate = '';
|
||||
static String arrayPromemoria = '';
|
||||
static String description = '';
|
||||
String description = '';
|
||||
static Priority priority = Priority.none;
|
||||
|
||||
static Color color = Color.none;
|
||||
|
||||
Promemoria(String description){
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ class _InboxViewState extends State<InboxView> {
|
||||
),
|
||||
body: ListView(
|
||||
children: const <Widget>[
|
||||
Reminder(),
|
||||
Reminder(),
|
||||
/* Reminder(),
|
||||
Reminder(),*/
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
@@ -16,6 +16,14 @@ class _TodayViewState extends State<TodayView> {
|
||||
|
||||
var _selectedDate = DateTime.now();
|
||||
|
||||
List<Promemoria> listaPromemoria = [
|
||||
new Promemoria("Primo promemoria"),
|
||||
new Promemoria("Secondo promemoria"),
|
||||
new Promemoria("Terzo promemoria"),
|
||||
];
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -33,10 +41,18 @@ class _TodayViewState extends State<TodayView> {
|
||||
),
|
||||
),
|
||||
body: ListView(
|
||||
children: const <Widget>[
|
||||
Reminder(),
|
||||
Reminder(),
|
||||
QuickReminder()
|
||||
children: [
|
||||
ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
itemCount: listaPromemoria.length,
|
||||
itemBuilder: (BuildContext context, int index){
|
||||
return Reminder(
|
||||
listaPromemoria[index]
|
||||
);
|
||||
},
|
||||
),
|
||||
QuickReminder(),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user