bottomSheetView method
Implementation
bottomSheetView(BuildContext context) {
showModalBottomSheet(
useRootNavigator: true,
backgroundColor: Colors.transparent,
context: context,
builder: (builder) {
return SafeArea(
child: SizedBox(
width: NavUtils.size.width,
child: Theme(
data: Theme.of(context).copyWith(
cardTheme:
AppStyleConfig.profileViewStyle.bottomSheetCardTheme),
child: Card(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(
height: 10,
),
Text(
getTranslated("options"),
style: AppStyleConfig.profileViewStyle.optionStyle,
),
const SizedBox(
height: 10,
),
ListTile(
dense: true,
contentPadding: EdgeInsets.zero,
onTap: () {
NavUtils.back();
controller.camera();
},
title: Text(
getTranslated("takePhoto"),
style: AppStyleConfig
.profileViewStyle.optionsTextStyle,
// style: const TextStyle(color: textColor, fontWeight: FontWeight.bold, fontSize: 14),
),
),
ListTile(
dense: true,
contentPadding: EdgeInsets.zero,
onTap: () {
NavUtils.back();
controller.imagePicker(context);
},
title: Text(
getTranslated("chooseFromGallery"),
style: AppStyleConfig
.profileViewStyle.optionsTextStyle,
// style: const TextStyle(color: textColor, fontWeight: FontWeight.bold, fontSize: 14),
),
),
controller.userImgUrl.value.isNotEmpty ||
controller.imagePath.value.isNotEmpty
? ListTile(
dense: true,
contentPadding: EdgeInsets.zero,
onTap: () {
NavUtils.back();
DialogUtils.showAlert(
dialogStyle: AppStyleConfig.dialogStyle,
message: getTranslated(
"areYouSureToRemovePhoto"),
actions: [
TextButton(
style: AppStyleConfig
.dialogStyle.buttonStyle,
onPressed: () {
NavUtils.back();
},
child: Text(
getTranslated("cancel")
.toUpperCase(),
)),
TextButton(
style: AppStyleConfig
.dialogStyle.buttonStyle,
onPressed: () {
NavUtils.back();
controller.removeProfileImage();
},
child: Text(
getTranslated("remove")
.toUpperCase(),
))
]);
},
title: Text(
getTranslated("removePhoto"),
style: AppStyleConfig
.profileViewStyle.optionsTextStyle,
// style: const TextStyle(color: textColor, fontWeight: FontWeight.bold, fontSize: 14),
),
)
: const Offstage(),
],
),
),
),
),
),
);
});
}