Compare commits
3 Commits
f72f86d8ae
...
dc817797f3
Author | SHA1 | Date | |
---|---|---|---|
dc817797f3 | |||
71789f6cdb | |||
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) {
|
||||
@ -185,8 +187,17 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
||||
}
|
||||
|
||||
void _handleChange(String mountType) {
|
||||
if (_mountType == mountType) {
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_mountType = mountType;
|
||||
_mountNameController.text =
|
||||
(mountType == 'Sia' && _mountNameController.text.isEmpty)
|
||||
? 'default'
|
||||
: '';
|
||||
|
||||
_mount =
|
||||
(_mountNameController.text.isEmpty)
|
||||
? null
|
||||
|
Loading…
x
Reference in New Issue
Block a user