show method

void show({
  1. String? text,
})

display a custom popup with an optional text parameter

Implementation

void show({String? text}) {
  if (!_showing) {
    _showing = true;
    AtEventNotificationListener()
        .navKey!
        .currentState!
        .push(CustomPopupRoutes(
            pageBuilder: (_, __, ___) {
              return Center(
                child: (text != null)
                    ? Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Flexible(
                            child: Text(
                              text,
                              textScaler: const TextScaler.linear(1),
                              style: TextStyle(
                                  color: AllColors().MILD_GREY,
                                  fontSize: 20.toFont,
                                  fontWeight: FontWeight.w400,
                                  decoration: TextDecoration.none),
                            ),
                          ),
                          TypingIndicator(
                            showIndicator: true,
                            flashingCircleBrightColor: AllColors().LIGHT_GREY,
                            flashingCircleDarkColor: AllColors().DARK_GREY,
                          ),
                        ],
                      )
                    : const CircularProgressIndicator(),
              );
            },
            barrierDismissible: false))
        .then((_) {});
  }
}