title: Is it possible to pass class as a parameter in a function in Flutter?
body: <p>Here, I have a utility class in which I have a function for showing DialogBox, so I'm trying to make an AlertDialog Box which can be used anywhere in the whole project.</p>
  <p>So, <strong>I have to pass Title, description as an argument and also want to pass Class name so that when the button inside the alert dialog is pressed we can navigate to that screen</strong></p>
  <pre><code>class DialogBox {
    static DialogBox dialogBox = null;
  
    static DialogBox getInstance() {
      if (dialogBox == null) {
        dialogBox = DialogBox();
      }
      return dialogBox;
    }
  
    showAlertDialog(BuildContext context, String alertTitle, String alertMessage) {
      showDialog(
          context: context,
          barrierDismissible: false,
          builder: (context) {
            return AlertDialog(
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(15.0),
              ),
              title: Center(child: Text(alertTitle)),
              content: Column(
                mainAxisSize: MainAxisSize.min,
                children: &lt;Widget&gt;[
                  Text(
                    alertMessage,
                    textAlign: TextAlign.center,
                  ),
                  Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.end,
                      children: &lt;Widget&gt;[
                        FlatButton(
                          child: Center(
                              child: Text(
                            'Ok',
                            textAlign: TextAlign.center,
                          )),
                          onPressed: () {
                            Navigator.of(context).pop();
  //                          Navigator.of(context).push(MaterialPageRoute(
  //                              builder: (BuildContext context) {
  //                            return Home();//Intead of  giving Home() anything can be passed here  
  //                          }));
                          },
                        ),
                      ])
                ],
              ),
            );
          });
    }
  }
  </code></pre>
  <p>Right now I have just kept closing the dialog box but there I want to navigate to another class.</p>