Add comment field to recording

This commit is contained in:
Elias Projahn 2020-04-12 11:50:32 +02:00
parent e9f0bd03e7
commit 4decd17875
2 changed files with 19 additions and 1 deletions

View file

@ -32,7 +32,8 @@ CREATE TABLE ensembles (
CREATE TABLE recordings (
id INTEGER NOT NULL PRIMARY KEY,
work INTEGER REFERENCES works(id)
work INTEGER REFERENCES works(id),
comment TEXT NOT NULL
);
CREATE TABLE performances (

View file

@ -18,6 +18,8 @@ class RecordingEditor extends StatefulWidget {
}
class _RecordingEditorState extends State<RecordingEditor> {
final commentController = TextEditingController();
Work work;
List<PerformanceModel> performances = [];
@ -59,6 +61,7 @@ class _RecordingEditorState extends State<RecordingEditor> {
final recording = Recording(
id: widget.recording?.id ?? generateId(),
work: work.id,
comment: commentController.text,
);
await backend.db.updateRecording(recording, performances);
@ -79,6 +82,20 @@ class _RecordingEditorState extends State<RecordingEditor> {
subtitle: Text('Select work'),
onTap: selectWork,
),
Padding(
padding: const EdgeInsets.only(
left: 16.0,
right: 16.0,
top: 0.0,
bottom: 16.0,
),
child: TextField(
controller: commentController,
decoration: InputDecoration(
labelText: 'Comment',
),
),
),
ListTile(
title: Text('Performers'),
trailing: IconButton(