feat:增加记录对话框内容
This commit is contained in:
46
lib/widget/dropdown_select.dart
Normal file
46
lib/widget/dropdown_select.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:getwidget/getwidget.dart';
|
||||
|
||||
class DropdownSelect extends StatelessWidget {
|
||||
final String value;
|
||||
final ValueChanged<String?> onChanged;
|
||||
final List<String> items;
|
||||
|
||||
const DropdownSelect({
|
||||
Key? key,
|
||||
required this.value,
|
||||
required this.onChanged,
|
||||
required this.items,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
|
||||
return Container(
|
||||
width: 150,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: colors.primary, width: 1.5),
|
||||
),
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: GFDropdown(
|
||||
itemHeight: 32,
|
||||
padding: const EdgeInsets.all(0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
items:
|
||||
items
|
||||
.map(
|
||||
(value) => DropdownMenuItem(
|
||||
value: value,
|
||||
child: Text(value, style: const TextStyle(fontSize: 16)),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user