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),
|
const SizedBox(width: constants.padding),
|
||||||
DropdownButton<String>(
|
DropdownButton<String>(
|
||||||
value: _mountType,
|
value: _mountType,
|
||||||
onChanged: (mountType) => _handleChange(mountType ?? ''),
|
onChanged: (mountType) {
|
||||||
|
_handleChange(mountType ?? '');
|
||||||
|
},
|
||||||
items:
|
items:
|
||||||
constants.providerTypeList
|
constants.providerTypeList
|
||||||
.map<DropdownMenuItem<String>>((item) {
|
.map<DropdownMenuItem<String>>((item) {
|
||||||
@ -185,8 +187,17 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _handleChange(String mountType) {
|
void _handleChange(String mountType) {
|
||||||
|
if (_mountType == mountType) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_mountType = mountType;
|
_mountType = mountType;
|
||||||
|
_mountNameController.text =
|
||||||
|
(mountType == 'Sia' && _mountNameController.text.isEmpty)
|
||||||
|
? 'default'
|
||||||
|
: '';
|
||||||
|
|
||||||
_mount =
|
_mount =
|
||||||
(_mountNameController.text.isEmpty)
|
(_mountNameController.text.isEmpty)
|
||||||
? null
|
? null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user