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), 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) {
@ -187,6 +189,12 @@ class _AddMountScreenState extends State<AddMountScreen> {
void _handleChange(String mountType) { void _handleChange(String mountType) {
setState(() { setState(() {
_mountType = mountType; _mountType = mountType;
if (_mountType == "Sia" && _mountNameController.text.isEmpty) {
_mountNameController.text = 'default';
} else {
_mountNameController.text = '';
}
_mount = _mount =
(_mountNameController.text.isEmpty) (_mountNameController.text.isEmpty)
? null ? null