Compare commits

...

3 Commits

Author SHA1 Message Date
dc817797f3 Create management portal in Flutter #39
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-03-14 18:57:33 -05:00
71789f6cdb Create management portal in Flutter #39 2025-03-14 18:57:04 -05:00
6e8f843252 Create management portal in Flutter #39 2025-03-14 18:54:31 -05:00

View File

@ -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