finishCommit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class StaticLocationDropdown extends StatelessWidget {
|
||||
const StaticLocationDropdown({super.key, required this.selectedValue});
|
||||
|
||||
final RxnString selectedValue;
|
||||
|
||||
static const List<String> _locations = [
|
||||
'TraunPV',
|
||||
'TraunImport',
|
||||
'SarleinsbachPV',
|
||||
'SarleinsbachImport',
|
||||
'LannachPV',
|
||||
'LannachImport',
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(() => DropdownButtonFormField<String>(
|
||||
initialValue: selectedValue.value ?? _locations.first,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Select Location / Data Source',
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 15),
|
||||
),
|
||||
items: _locations.map((String location) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: location,
|
||||
child: Text(location),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (String? newValue) {
|
||||
selectedValue.value = newValue;
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user