mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
Add access to person editor to person selector
The person editor can be reached via the FAB. If a new person is created, it will be selected.
This commit is contained in:
parent
2ee49246e4
commit
cc45018c83
1 changed files with 35 additions and 17 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../backend.dart';
|
||||
import '../database.dart';
|
||||
import '../editors/person.dart';
|
||||
|
||||
class PersonsSelector extends StatelessWidget {
|
||||
@override
|
||||
|
|
@ -29,7 +31,23 @@ class PersonsSelector extends StatelessWidget {
|
|||
} else {
|
||||
return Container();
|
||||
}
|
||||
}),
|
||||
},
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
child: const Icon(Icons.add),
|
||||
onPressed: () async {
|
||||
final Person person = await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => PersonEditor(),
|
||||
fullscreenDialog: true,
|
||||
));
|
||||
|
||||
if (person != null) {
|
||||
Navigator.pop(context, person);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue