38 lines
935 B
Dart
38 lines
935 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class GlobalDropdownField<T> extends StatelessWidget {
|
|
final T value;
|
|
final List<DropdownMenuItem<T>> items;
|
|
final ValueChanged<T?> onChanged;
|
|
|
|
const GlobalDropdownField({
|
|
super.key,
|
|
required this.value,
|
|
required this.items,
|
|
required this.onChanged,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
|
decoration: BoxDecoration(
|
|
color: const Color.fromARGB(255, 234, 234, 235),
|
|
borderRadius: BorderRadius.circular(16),
|
|
border: Border.all(
|
|
color: const Color(0xFF0052CC),
|
|
width: 1.5,
|
|
),
|
|
),
|
|
child: DropdownButtonHideUnderline(
|
|
child: DropdownButton<T>(
|
|
value: value,
|
|
isExpanded: true,
|
|
onChanged: onChanged,
|
|
items: items,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|