mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
common: Expose sync property in editors
This commit is contained in:
parent
6c7891de14
commit
322ed3f81e
6 changed files with 78 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ class _InstrumentEditorState extends State<InstrumentEditor> {
|
|||
final nameController = TextEditingController();
|
||||
|
||||
bool uploading = false;
|
||||
bool _sync = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
@ -59,6 +60,8 @@ class _InstrumentEditorState extends State<InstrumentEditor> {
|
|||
final instrument = Instrument(
|
||||
id: widget.instrument?.id ?? generateId(),
|
||||
name: nameController.text,
|
||||
sync: _sync,
|
||||
synced: false,
|
||||
);
|
||||
|
||||
final success =
|
||||
|
|
@ -81,6 +84,18 @@ class _InstrumentEditorState extends State<InstrumentEditor> {
|
|||
),
|
||||
body: ListView(
|
||||
children: <Widget>[
|
||||
SwitchListTile(
|
||||
title: Text('Synchronize changes'),
|
||||
subtitle: Text(_sync
|
||||
? 'Publish changes on the server'
|
||||
: 'Keep changes private'),
|
||||
value: _sync,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_sync = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: TextField(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue