openMensagem method

void openMensagem(
  1. Widget mensagem, {
  2. double width = 500,
  3. double height = 500,
})

abre um pop-up com o widget

Implementation

void openMensagem(Widget mensagem, {double width = 500, double height = 500}) {
  Modular.to.push(
    PageRouteBuilder(
      opaque: false,
      barrierColor: Colors.black.withValues(alpha: 0.5),
      pageBuilder: (context, animation, secondaryAnimation) => AlertDialog(
        insetPadding: const EdgeInsets.all(0),
        contentPadding: const EdgeInsets.all(0),
        backgroundColor: Colors.white,
        content: Container(
          width: !isTelaPequena(context) ? width : 1000,
          height: !isTelaPequena(context) ? height : 1000,
          child: Scaffold(
            appBar: AppBar(
              backgroundColor: Theme.of(context).primaryColor,
            ),
            body: mensagem,
          ),
        ),
      ),
    ),
  );
}