Create management portal in Flutter #39
This commit is contained in:
parent
f72f86d8ae
commit
6e8f843252
@ -67,7 +67,9 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
||||
const SizedBox(width: constants.padding),
|
||||
DropdownButton<String>(
|
||||
value: _mountType,
|
||||
onChanged: (mountType) => _handleChange(mountType ?? ''),
|
||||
onChanged: (mountType) {
|
||||
_handleChange(mountType ?? '');
|
||||
},
|
||||
items:
|
||||
constants.providerTypeList
|
||||
.map<DropdownMenuItem<String>>((item) {
|
||||
@ -187,6 +189,12 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
||||
void _handleChange(String mountType) {
|
||||
setState(() {
|
||||
_mountType = mountType;
|
||||
if (_mountType == "Sia" && _mountNameController.text.isEmpty) {
|
||||
_mountNameController.text = 'default';
|
||||
} else {
|
||||
_mountNameController.text = '';
|
||||
}
|
||||
|
||||
_mount =
|
||||
(_mountNameController.text.isEmpty)
|
||||
? null
|
||||
|
Loading…
x
Reference in New Issue
Block a user