reject method
Implementation
reject(BuildContext context, Widget widget) {
final TextEditingController addReasonController = TextEditingController();
showModalBottomSheet<void>(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return SizedBox(
height: SizeConstant.getHeightWithScreen(376),
child: Stack(children: [
Column(children: [
Container(
height: SizeConstant.getHeightWithScreen(60),
color: Colors.transparent,
),
Container(
height: SizeConstant.getHeightWithScreen(316),
padding: const EdgeInsets.all(20.0),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: ColorConstant.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: SizeConstant.getHeightWithScreen(26),
),
Center(
child: Text(
'Are you sure you want to reject the Distributor collection'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: ColorConstant.black3,
fontSize: SizeConstant.mediumFont,
fontWeight: FontWeight.w500,
fontFamily: 'Poppins'
),
)),
SizedBox(
height: SizeConstant.getHeightWithScreen(10),
),
Center(
child: Text(
'Confirm cancellation? This action will remove all scanned items and cancel the transaction'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: ColorConstant.grey5,
fontSize: SizeConstant.smallFont,
fontWeight: FontWeight.w500,
),
)),
SizedBox(height: SizeConstant.getHeightWithScreen(23.5)),
VentasPrimaryTextField(
height: SizeConstant.getHeightWithScreen(94),
inputFormatters: [
LengthLimitingTextInputFormatter(60),
],
textInputType: TextInputType.visiblePassword,
controller: addReasonController,
hintText: 'Reject Reason'.tr,
hintTextColor:
ColorConstant.tfTextColor.withOpacity(.60),
borderColor: ColorConstant.tfDisabledBorderColor,
fillColor: Colors.transparent,
isPassword: false,
onChanged: (p0) {
// setState(() {
// isOTPMatching = true;
// });
},
),
SizedBox(height: SizeConstant.getHeightWithScreen(38.5)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
VentasPrimaryButton(
onTap: () {
Navigator.pop(context);
},
label: Strings.cancel.tr,
btnHeight: SizeConstant.getHeightWithScreen(40),
btnWidth: SizeConstant.getHeightWithScreen(150),
textColor: ColorConstant.primaryColor,
borderRadius: SizeConstant.xSmallFont,
bgColor: ColorConstant.white,
borderColor: ColorConstant.primaryColor),
SizedBox(
width: SizeConstant.getHeightWithScreen(20)),
VentasPrimaryButton(
onTap: () {
Get.to(() => const CollectStockRejected());
},
label: 'Confirm'.tr,
btnHeight: SizeConstant.getHeightWithScreen(40),
btnWidth: SizeConstant.getHeightWithScreen(150),
textColor: ColorConstant.white,
borderRadius: SizeConstant.xSmallFont,
bgColor: ColorConstant.primaryColor,
borderColor: ColorConstant.white)
],
),
/* const SizedBox(height: 20.0),*/
]),
)
]),
Positioned(
left: MediaQuery.of(context).size.width / 2 -
SizeConstant.getHeightWithScreen(32),
top: SizeConstant.getHeightWithScreen(32),
child: CircleAvatar(
radius: SizeConstant.getHeightWithScreen(28),
backgroundColor: ColorConstant.primaryColor,
child: SizedBox(
height: SizeConstant.getHeightWithScreen(22.5),
width: SizeConstant.getHeightWithScreen(22.5),
child: SvgPicture.asset(
'assets/images/collect_stock.svg',
package: "common",
),
),
)),
]));
},
);
}