add note button

This commit is contained in:
Giulia
2023-09-28 09:07:00 +02:00
committed by Joe Küng
parent 1ff2e9da0a
commit 92f3dcf84d
2 changed files with 17 additions and 8 deletions

View File

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

View File

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