removeAllAssetsBottomsheet static method

dynamic removeAllAssetsBottomsheet(
  1. String message,
  2. String? content,
  3. VoidCallback onDelete,
  4. double width,
  5. BuildContext context,
  6. String assetName,
)

Implementation

static removeAllAssetsBottomsheet(
    String message,
    String? content,
    VoidCallback onDelete,
    double width,
    BuildContext context,
    String assetName) {
  showModalBottomSheet<void>(
    context: context,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(30.0),
    ),
    backgroundColor: Colors.transparent,
    builder: (BuildContext context) {
      return SizedBox(
        height: SizeConstant.getHeightWithScreen(content != null ? 299 : 261),
        child: Stack(
          children: [
            Column(children: [
              Container(
                height: SizeConstant.getHeightWithScreen(38),
                color: Colors.transparent,
              ),
              Container(
                height: SizeConstant.getHeightWithScreen(
                    content != null ? 261 : 223),
                padding: EdgeInsets.only(
                  bottom: MediaQuery.of(context).viewInsets.bottom,
                ),
                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(
                            content != null ? 53 : 82),
                      ),
                      Padding(
                        padding: EdgeInsets.symmetric(
                          horizontal: SizeConstant.getHeightWithScreen(63),
                        ),
                        child: Text(
                          message,
                          style: TextStyle(
                            color: ColorConstant.black3,
                            fontSize: SizeConstant.mediumFont,
                            fontWeight: FontWeight.w600,
                          ),
                          textAlign: TextAlign.center,
                        ),
                      ),
                      if (content != null)
                        Padding(
                          padding: EdgeInsets.only(
                            left: SizeConstant.getHeightWithScreen(63),
                            right: SizeConstant.getHeightWithScreen(63),
                            top: SizeConstant.getHeightWithScreen(20),
                          ),
                          child: Text(
                            content,
                            style: TextStyle(
                              color: ColorConstant.grey5,
                              fontSize: SizeConstant.smallFont,
                              fontWeight: FontWeight.w500,
                            ),
                            textAlign: TextAlign.center,
                          ),
                        ),
                      SizedBox(
                          height: SizeConstant.getHeightWithScreen(
                              content != null ? 73 : 40)),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          VentasPrimaryButton(
                              onTap: () {
                                Get.back();
                              },
                              label: localization.translate('cancel'),
                              btnHeight: SizeConstant.getHeightWithScreen(40),
                              btnWidth: width,
                              textColor: ColorConstant.primaryColor,
                              borderRadius: SizeConstant.xSmallFont,
                              bgColor: ColorConstant.white,
                              borderColor: ColorConstant.primaryColor),
                          SizedBox(
                              width: SizeConstant.getHeightWithScreen(20)),
                          VentasPrimaryButton(
                              onTap: () {
                                onDelete();
                              },
                              label: localization.translate('confirm'),
                              btnHeight: SizeConstant.getHeightWithScreen(40),
                              btnWidth: width,
                              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(38),
              top: 0,
              child: CircleAvatar(
                radius: SizeConstant.getHeightWithScreen(38),
                backgroundColor: ColorConstant.primaryColor,
                child: SizedBox(
                  height: SizeConstant.getHeightWithScreen(32),
                  width: SizeConstant.getHeightWithScreen(32),
                  child: SvgPicture.asset(
                    'assets/images/$assetName',
                    package: Constants.packageName,
                  ),
                ),
              ),
            ),
          ],
        ),
      );
    },
  );
}