waiting static method

dynamic waiting({
  1. required BuildContext context,
  2. required ModalTitle title,
  3. String? message,
})

Shows a dialog with a title and a message. This dialog can only be dismissed by the application, since it has no buttons. You should pair this dialog with a Future.delayed() and a Navigator.pop() to dismiss it.

Implementation

static waiting({
  required BuildContext context,
  required ModalTitle title,
  String? message,
}) {
  return showDialog(
    context: context,
    barrierDismissible: false,
    builder: (BuildContext context) {
      return _BaseAlertDialog(
        content: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            const Divider(
              color: Colors.transparent,
              height: 18,
            ),
            const Center(
              child: LinearProgressIndicator(color: Color(0xFF303F9F)),
            ),
            const Divider(
              color: Colors.transparent,
              height: 18,
            ),
            Align(
              alignment: Alignment.center,
              child: Text(
                title.text,
                textAlign: TextAlign.center,
                style: TextStyle(
                  color: title.color ?? const Color(0xFF25282B),
                  fontWeight: FontWeight.bold,
                  fontSize: 20,
                ),
              ),
            ),
            Visibility(
              visible: message != null,
              child: Column(
                children: [
                  const Divider(
                    color: Colors.transparent,
                    height: 6,
                  ),
                  Align(
                    alignment: Alignment.center,
                    child: Text(
                      message ?? "",
                      textAlign: TextAlign.center,
                      style: const TextStyle(
                        color: Color(0xFF52575C),
                        fontWeight: FontWeight.w500,
                        fontSize: 14,
                      ),
                    ),
                  ),
                ],
              ),
            ),
            const Divider(
              color: Colors.transparent,
              height: 12,
            ),
          ],
        ),
      );
    },
  );
}