pickImage method

void pickImage(
  1. BuildContext context
)

Implementation

void pickImage(BuildContext context) {
  const double BUTTON_MAX_WIDTH = 600;
  final theme = Provider.of<ThemeRepository>(context, listen: false).theme;

  SeniorBottomSheet.showDynamicBottomSheet(
    context: context,
    isDismissible: true,
    hasCloseButton: false,
    content: [
      Container(
        child: Padding(
          padding: EdgeInsets.only(
            bottom:
                SeniorSpacing.normal + MediaQuery.of(context).padding.bottom,
          ),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            mainAxisSize: MainAxisSize.min,
            children: [
              SeniorButton.primary(
                label: takePhotoLabel,
                fullWidth:
                    MediaQuery.of(context).size.width < BUTTON_MAX_WIDTH,
                onPressed: () {
                  _imgFromCamera(theme);
                  Navigator.pop(context);
                },
              ),
              const SizedBox(
                height: SeniorSpacing.medium,
              ),
              SeniorButton.secondary(
                label: pickImageLabel,
                fullWidth:
                    MediaQuery.of(context).size.width < BUTTON_MAX_WIDTH,
                onPressed: () {
                  _imgFromGallery(theme);
                  Navigator.pop(context);
                },
              ),
            ],
          ),
        ),
      ),
    ],
  );
}