showLoader method

dynamic showLoader({
  1. bool dismissible = false,
  2. bool canUserPop = false,
  3. bool dense = false,
  4. String? message,
})

Implementation

showLoader(
    {bool dismissible = false,
    bool canUserPop = false,
    bool dense = false,
    String? message}) {
  dialog(
      WillPopScope(
        onWillPop: () async {
          return canUserPop;
        },
        child: Container(
          alignment: Alignment.center,
          child: SizedBox(
            width: Get.width * 0.6,
            height: Get.width * 0.6,
            child: Card(
              color: Colors.white,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(10),
              ),
              margin: const EdgeInsets.all(10),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  const CircularProgressIndicator(
                    backgroundColor: Colors.green,
                    valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
                  ),
                  const SizedBox(
                    height: 20,
                  ),
                  Text(
                    message ?? processingDialogBoxTitle,
                    style: const TextStyle(
                      fontSize: 20,
                      fontWeight: FontWeight.w500,
                      color: Colors.black,
                    ),
                    textAlign: TextAlign.center,
                    overflow: TextOverflow.ellipsis,
                    maxLines: 2,
                  )
                ],
              ),
            ),
          ),
        ),
      ),
      barrierDismissible: dismissible);
}