showAppImagePicker method

Future<File?> showAppImagePicker({
  1. required BuildContext context,
})

Implementation

Future<File?> showAppImagePicker({required BuildContext context}) async {
  await showModalBottomSheet<File>(
      context: context,
      backgroundColor: Colors.white,
      builder: (builder) {
        return Wrap(
          children: [
            SafeArea(
                child: ListView(
              shrinkWrap: true,
              children: [
                ListTile(
                    trailing: Icon(Icons.camera_alt),
                    title: Text('Camera'),
                    onTap: () async {
                      file = await appImagePick(
                          source: ImageSource.camera, context: context);
                    }),
                ListTile(
                    trailing: Icon(Icons.image),
                    title: Text('Gallery'),
                    onTap: () async {
                      file = await appImagePick(
                          source: ImageSource.gallery, context: context);
                    })
              ],
            ))
          ],
        );
      });

  return file;
}