mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
Make person and work editor accessible
This commit is contained in:
parent
743e0db4cf
commit
319818a276
2 changed files with 34 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../backend.dart';
|
import '../backend.dart';
|
||||||
import '../database.dart';
|
import '../database.dart';
|
||||||
|
import '../editors/person.dart';
|
||||||
|
|
||||||
import 'work.dart';
|
import 'work.dart';
|
||||||
|
|
||||||
|
|
@ -19,6 +20,22 @@ class PersonScreen extends StatelessWidget {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('${person.firstName} ${person.lastName}'),
|
title: Text('${person.firstName} ${person.lastName}'),
|
||||||
|
actions: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.edit),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => PersonEditor(
|
||||||
|
person: person,
|
||||||
|
),
|
||||||
|
fullscreenDialog: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
body: StreamBuilder<List<Work>>(
|
body: StreamBuilder<List<Work>>(
|
||||||
stream: backend.db.worksByComposer(person.id).watch(),
|
stream: backend.db.worksByComposer(person.id).watch(),
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../backend.dart';
|
import '../backend.dart';
|
||||||
import '../database.dart';
|
import '../database.dart';
|
||||||
|
import '../editors/work.dart';
|
||||||
|
|
||||||
class WorkScreen extends StatelessWidget {
|
class WorkScreen extends StatelessWidget {
|
||||||
final Work work;
|
final Work work;
|
||||||
|
|
@ -17,6 +18,22 @@ class WorkScreen extends StatelessWidget {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(work.title),
|
title: Text(work.title),
|
||||||
|
actions: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.edit),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => WorkEditor(
|
||||||
|
work: work,
|
||||||
|
),
|
||||||
|
fullscreenDialog: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
body: StreamBuilder<List<Work>>(
|
body: StreamBuilder<List<Work>>(
|
||||||
stream: backend.db.workParts(work.id).watch(),
|
stream: backend.db.workParts(work.id).watch(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue