showBottonSheetImageSource static method

Future<ImageSource?> showBottonSheetImageSource()

Implementation

static Future<ImageSource?> showBottonSheetImageSource() async {
  if (kIsWeb) {
    return ImageSource.gallery;
  }
  BuildContext context = ModernFormGlobalContext.context!;
  return await showModalBottomSheet(
    context: context,
    builder: (BuildContext context) {
      return SafeArea(
        child: SingleChildScrollView(
          child: Container(
            child: Wrap(
              children: <Widget>[
                ListTile(
                    onTap: () {
                      Navigator.pop(context, ImageSource.camera);
                    },
                    title: Text("Câmera"),
                    leading: Icon(Icons.camera_alt)),
                ListTile(
                    onTap: () {
                      Navigator.pop(context, ImageSource.gallery);
                    },
                    title: Text("Galeria"),
                    leading: Icon(Icons.image)),
              ],
            ),
          ),
        ),
      );
    },
  );
}