KonectarApp/lib/widgets/customdropdown.dart

32 lines
704 B
Dart
Raw Normal View History

2024-09-06 06:30:31 +00:00
import 'package:flutter/material.dart';
class CustomDropdown extends StatelessWidget {
late List<String>? items;
late VoidCallback onChanged;
String? hint;
CustomDropdown(
{super.key,
required items,
required hint,
required Null Function() onChanged});
@override
Widget build(BuildContext context) {
return SizedBox(
width: 200,
child: DropdownButton<String>(
hint: Text(hint!),
items: items!.map((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
onChanged: (value) {
onChanged();
},
),
);
}
}