showOptionDialog static method
Future
showOptionDialog(
- BuildContext context,
- String title,
- List values,
- String id, {
- Color primaryColor = Colors.white,
Implementation
static Future<dynamic> showOptionDialog(BuildContext context, String title,
final List<dynamic> values, String id, {Color primaryColor = Colors.white}) {
final double height = 49 * (values.length + 1).sp + (values.length * 2).sp;
final double max = 1.sh - 20.sp - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight;
return showDialog(context: context, builder: (context) =>
Column(mainAxisAlignment: MainAxisAlignment.end, mainAxisSize: MainAxisSize.min,
children: [
Container(height: height > max ? max : height,
margin: EdgeInsets.fromLTRB(0.1.sw, 0, 0.1.sw, 20.sp),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.sp)),
child: ListView(padding: EdgeInsets.zero, children: createItems(context, title, values, id, primaryColor)))
]));
}