continue settings
This commit is contained in:
parent
c817d432c0
commit
892d13ec99
@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import 'package:repertory/constants.dart' as constants;
|
import 'package:repertory/constants.dart' as constants;
|
||||||
import 'package:repertory/helpers.dart';
|
import 'package:repertory/helpers.dart';
|
||||||
import 'package:repertory/models/mount_list.dart';
|
import 'package:repertory/models/mount_list.dart';
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:repertory/types/mount_config.dart';
|
import 'package:repertory/types/mount_config.dart';
|
||||||
import 'package:settings_ui/settings_ui.dart';
|
import 'package:settings_ui/settings_ui.dart';
|
||||||
|
|
||||||
@ -38,7 +39,44 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
SettingsTile.navigation(
|
SettingsTile.navigation(
|
||||||
leading: Icon(Icons.onetwothree),
|
leading: Icon(Icons.onetwothree),
|
||||||
title: Text(key),
|
title: Text(key),
|
||||||
value: Text((value as int).toString()),
|
value: Text(value.toString()),
|
||||||
|
onPressed: (_) {
|
||||||
|
String updatedValue = value.toString();
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
child: Text('Cancel'),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: Text('OK'),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
root?[key] = int.parse(updatedValue);
|
||||||
|
});
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
content: TextField(
|
||||||
|
autofocus: true,
|
||||||
|
controller: TextEditingController(text: updatedValue),
|
||||||
|
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
onChanged: (nextValue) {
|
||||||
|
updatedValue = nextValue;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Text(key),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -80,6 +118,41 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
|
|||||||
leading: Icon(icon),
|
leading: Icon(icon),
|
||||||
title: Text(key),
|
title: Text(key),
|
||||||
value: Text(value),
|
value: Text(value),
|
||||||
|
onPressed: (_) {
|
||||||
|
String updatedValue = value;
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
child: Text('Cancel'),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: Text('OK'),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
root?[key] = updatedValue;
|
||||||
|
});
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
content: TextField(
|
||||||
|
autofocus: true,
|
||||||
|
controller: TextEditingController(text: updatedValue),
|
||||||
|
onChanged: (value) {
|
||||||
|
updatedValue = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Text(key),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user