Create management portal in Flutter #39

This commit is contained in:
Scott E. Graves 2025-03-14 18:54:31 -05:00
parent f72f86d8ae
commit 6e8f843252

View File

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