add note button

This commit is contained in:
Giulia
2023-09-28 09:07:00 +02:00
parent 2f851bc630
commit bf7981671d
2 changed files with 17 additions and 8 deletions

View File

@@ -1,4 +1,3 @@
import 'package:progetto_m335_flutter/model/note.dart'; import 'package:progetto_m335_flutter/model/note.dart';
class Database{ class Database{

View File

@@ -1,7 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'NoteDetailView.dart';
class NotesView extends StatefulWidget { class NotesView extends StatefulWidget {
const NotesView({super.key}); const NotesView({Key? key}) : super(key: key);
@override @override
State<NotesView> createState() => _NotesViewState(); State<NotesView> createState() => _NotesViewState();
@@ -10,12 +11,21 @@ class NotesView extends StatefulWidget {
class _NotesViewState extends State<NotesView> { class _NotesViewState extends State<NotesView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const Scaffold( return Scaffold(
body: Center( appBar: AppBar(
child: Icon(Icons.note), title: Text('Note'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const NoteDetailView(),
), ),
); );
},
child: Icon(Icons.add),
),
);
}
}
}
}