showOptionDialog static method

Future showOptionDialog(
  1. BuildContext context,
  2. String title,
  3. List values,
  4. String id, {
  5. 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)))
          ]));
}