getFreeItems method

dynamic getFreeItems(
  1. BuildContext context
)

Implementation

getFreeItems(BuildContext context) {
  showModalBottomSheet<void>(
    context: context,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(30.0),
    ),
    backgroundColor: Colors.transparent,
    builder: (BuildContext context) {
      return Container(
        height: SizeConstant.getHeightWithScreen(470),
        padding: EdgeInsets.all(SizeConstant.getHeightWithScreen(16)),
        decoration: BoxDecoration(
            color: ColorConstant.white,
            borderRadius: BorderRadius.only(
                topLeft:
                    Radius.circular(SizeConstant.getHeightWithScreen(15.0)),
                topRight:
                    Radius.circular(SizeConstant.getHeightWithScreen(15.0)))),
        child: Column(
          children: [
            Row(
              children: [
                Text(
                  localization.translate('freeItems'),
                  style: TextStyle(
                    color: ColorConstant.black3,
                    fontSize: SizeConstant.mediumLargeFont,
                    fontWeight: FontWeight.w500,
                  ),
                ),
              ],
            ),
            SizedBox(
              height: SizeConstant.getHeightWithScreen(27),
            ),
            Expanded(
              child: ListView.separated(
                separatorBuilder: (BuildContext context, int index) =>
                    SizedBox(
                  height: SizeConstant.getHeightWithScreen(15),
                ),
                shrinkWrap: true,
                itemCount: 3,
                itemBuilder: (ctx, id) => Container(
                  decoration: BoxDecoration(
                    color: ColorConstant.statusBarColor,
                    borderRadius: BorderRadius.all(
                      Radius.circular(SizeConstant.getHeightWithScreen(15)),
                    ),
                  ),
                  child: Container(
                    padding:
                        EdgeInsets.all(SizeConstant.getHeightWithScreen(16)),
                    decoration: BoxDecoration(
                        color: ColorConstant.dividerColor,
                        borderRadius: BorderRadius.all(Radius.circular(
                            SizeConstant.getHeightWithScreen(15.0)))),
                    child: Column(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Column(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Text(
                                    'Product Name',
                                    style: TextStyle(
                                      color: ColorConstant.black,
                                      fontSize: SizeConstant.smallFont,
                                      fontWeight: FontWeight.w500,
                                    ),
                                  ),
                                  SizedBox(
                                    height:
                                        SizeConstant.getHeightWithScreen(4),
                                  ),
                                  Text(
                                    'Code',
                                    style: TextStyle(
                                      color: ColorConstant.grey5,
                                      fontSize: SizeConstant.smallXFont,
                                      fontWeight: FontWeight.w500,
                                    ),
                                  ),
                                ],
                              ),
                              /* VentasPrimaryButton(
                                  onTap: () {
                                    Navigator.of(context).pop();
                                  },
                                  label: "apply".tr,
                                  btnHeight: SizeConstant.getHeightWithScreen(28),
                                  btnWidth: SizeConstant.getHeightWithScreen(55),
                                  fontFamily: 'Poppins-Medium',
                                  textColor: ColorConstant.primaryColor,
                                  borderRadius: SizeConstant.xSmallFont,
                                  bgColor: ColorConstant.white,
                                  borderColor: ColorConstant.primaryColor),*/
                              GestureDetector(
                                onTap: () {
                                  Navigator.of(context).pop();
                                },
                                child: Card(
                                  shape: const RoundedRectangleBorder(
                                    side: BorderSide(color: Colors.orange),
                                    borderRadius: BorderRadius.all(
                                        Radius.circular(7.0)),
                                  ),
                                  child: Container(
                                    height:
                                        SizeConstant.getHeightWithScreen(28),
                                    width:
                                        SizeConstant.getHeightWithScreen(55),
                                    decoration: BoxDecoration(
                                      color: ColorConstant.white,
                                      borderRadius: BorderRadius.all(
                                          Radius.circular(SizeConstant
                                              .getHeightWithScreen(7.0))),
                                    ),
                                    child: Center(
                                      child: Text(
                                        localization.translate('apply'),
                                        style: TextStyle(
                                          color: ColorConstant.primaryColor,
                                          fontSize: SizeConstant.smallFont,
                                          fontWeight: FontWeight.w600,
                                        ),
                                      ),
                                    ),
                                  ),
                                ),
                              )
                            ],
                          ),
                        ]),
                  ),
                ),
              ),
            )
          ],
        ),
      );
    },
  );
}