1
This commit is contained in:
33
lib/widgets/ui_kit/popup/popup_action.dart
Normal file
33
lib/widgets/ui_kit/popup/popup_action.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PopupAction extends StatelessWidget {
|
||||
final List<PopupMenuEntry<String>> items;
|
||||
final Widget child;
|
||||
final Function(String) onSelected;
|
||||
|
||||
const PopupAction({
|
||||
super.key,
|
||||
required this.items,
|
||||
required this.child,
|
||||
required this.onSelected,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopupMenuButton<String>(
|
||||
color: Colors.white,
|
||||
offset: Offset(0, 30),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12), // 圆角
|
||||
),
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 200,
|
||||
),
|
||||
elevation: 6,
|
||||
shadowColor: Colors.black87,
|
||||
onSelected:onSelected,
|
||||
itemBuilder: (context) => items,
|
||||
child:child ,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user