38 lines
1.0 KiB
Dart
38 lines
1.0 KiB
Dart
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;
|
|
},
|
|
));
|
|
}
|
|
} |