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