deleteFromApp function

void deleteFromApp(
  1. BuildContext context,
  2. dynamic onPress()
)

Implementation

void deleteFromApp(BuildContext context,Function() onPress) {
  showModalBottomSheet<void>(
    context: context,
    backgroundColor: white,
    shape: const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12))),
    builder: (BuildContext context) {
      return Wrap(
        children: [
          Container(
            margin: const EdgeInsets.all(15),
            decoration:
            const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)), color: white),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Container(
                  height: 2,
                  width: 40,
                  alignment: Alignment.center,
                  color: black,
                  margin: const EdgeInsets.only(top: 10, bottom: 10),
                ),
                /*Container(
                      margin: const EdgeInsets.only(top: 10, bottom: 10),
                      child: const Text('Logout from REECOSYS Sales', style: TextStyle(fontSize: 22, fontWeight: FontWeight.w400, color: black))),*/
                Container(
                  margin: const EdgeInsets.only(top: 10, bottom: 15),
                  child: const Text('Are you sure you want to delete?', style: TextStyle(fontSize: 18, fontWeight: FontWeight.w400, color: black)),
                ),
                Container(
                  margin: const EdgeInsets.only(left: 15, right: 15, bottom: 12, top: 20),
                  child: Row(
                    children: [
                      Expanded(
                        child: SizedBox(
                          height: kButtonHeight,
                          child: TextButton(
                            style: ButtonStyle(
                              shape: WidgetStateProperty.all<RoundedRectangleBorder>(
                                RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(kBorderRadius),
                                  side: const BorderSide(width: 1, color: black)
                                ),
                              ),
                              backgroundColor: WidgetStateProperty.all<Color>(Colors.transparent)
                            ),
                            onPressed: () {
                              Navigator.pop(context);
                            },
                            child: const Text("No", style: TextStyle(fontWeight: FontWeight.w400, fontSize: 16, color: black)),
                          )
                        )
                      ),
                      const Gap(20),
                      Expanded(
                        child: SizedBox(
                          height: kButtonHeight,
                          child: TextButton(
                            style: ButtonStyle(
                              shape: WidgetStateProperty.all<RoundedRectangleBorder>(
                                RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(kBorderRadius),
                                ),
                              ),
                              backgroundColor: WidgetStateProperty.all<Color>(black)
                            ),
                            onPressed:onPress,
                            child: const Text("Yes", style: TextStyle(fontWeight: FontWeight.w400, fontSize: 16, color: white)),
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ),
        ],
      );
    },
  );
}