title: I can't show my toast message with Flutter
body: <pre><code>Column(
    mainAxisAlignment: MainAxisAlignment.center,
    children: [
      signInButton(
        context,
        () {
          Navigator.of(context).push(MaterialPageRoute(
            builder: (context) =&gt; const HomeScreen(),
          ));
        },
        child: const Text(&quot;Toast Message&quot;),
      ),
    ],
  )
  </code></pre>
  <p><a href="https://pub.dev/packages/fluttertoast/example" rel="nofollow noreferrer">Same Example in here</a>
  I made almost the same code as seen in the link. The only difference is that I defined the button as a separate widget and gave the values ​​inside the widget. But when I go to HomeScreen, I can't see the Toast message. Do I need to define this in the widget too?</p>
  <pre><code>Container signInButton(BuildContext context, Function onTap, {required Text child}) {
    return Container(
      width: 250,
      height: 50,
      margin: const EdgeInsets.fromLTRB(0, 30, 0, 20),
      decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0)),
      child: ElevatedButton(
        style: ElevatedButton.styleFrom(
            primary: const Color.fromARGB(255, 221, 144, 56)),
        onPressed: () {
          onTap();
        },
        child: Text('Giriş Yap',
            style: GoogleFonts.poppins(
              fontWeight: FontWeight.w500,
            )),
      ),
    );
  </code></pre>
  <p>These are the codes of the widget I defined.</p>
  <p><a href="https://i.stack.imgur.com/qxGc7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qxGc7.png" alt="enter image description here" /></a></p>
  <p>When I press the button, the application stops and shows this line of code.</p>