From 4b46c8cc013f7ca0aa4520227d476f3568c67c89 Mon Sep 17 00:00:00 2001 From: Giulia Date: Fri, 29 Sep 2023 09:09:26 +0200 Subject: [PATCH] fix --- lib/{pages => Components}/Note.dart | 8 ++------ lib/pages/NotesView.dart | 32 ++++++++--------------------- 2 files changed, 10 insertions(+), 30 deletions(-) rename lib/{pages => Components}/Note.dart (86%) diff --git a/lib/pages/Note.dart b/lib/Components/Note.dart similarity index 86% rename from lib/pages/Note.dart rename to lib/Components/Note.dart index cc0a29f..c0d31c8 100644 --- a/lib/pages/Note.dart +++ b/lib/Components/Note.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'NoteDetailView.dart'; +import '../pages/NoteDetailView.dart'; class Note extends StatefulWidget { const Note({super.key}); @@ -12,10 +12,7 @@ class _NotesViewState extends State { @override Widget build(BuildContext context) { - return Card( - color: Colors.white, - - child: ListTile( + return ListTile( title: Text("ciao", style: TextStyle(color: Colors.lightBlue.shade900, fontWeight: FontWeight.bold),), subtitle: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [Text('Descrizione della nota:'),],), onTap: () { @@ -25,7 +22,6 @@ class _NotesViewState extends State { ), ); }, - ), ); } } \ No newline at end of file diff --git a/lib/pages/NotesView.dart b/lib/pages/NotesView.dart index 053b5eb..dbea091 100644 --- a/lib/pages/NotesView.dart +++ b/lib/pages/NotesView.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import '../Components/Note.dart'; import 'CreateNewNote.dart'; import 'NoteDetailView.dart'; @@ -16,8 +17,7 @@ class _NotesViewState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Note', style: TextStyle(color: Colors.white),), - backgroundColor: Colors.cyan.shade700, + title: Text('Note'), ), floatingActionButton: FloatingActionButton( onPressed: () { @@ -32,28 +32,12 @@ class _NotesViewState extends State { ), - body: Container( - child: ListView.builder( - itemCount: 5, - itemBuilder: (context, index) { - return Card( - color: Colors.white, - - child: ListTile( - title: Text("ciao", style: TextStyle(color: Colors.cyan.shade700, fontWeight: FontWeight.bold),), - subtitle: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [Text('Descrizione della nota:'),],), - onTap: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => const NoteDetailView(), - ), - ); - }, - ), - ); - }, - ), - ), + body:ListView( + children: const [ + Note(), + Note(), + ], + ) ); } }