title: How to get context in the any function of StatelessWidget?
body: <p>We want to show an AlertDialog after some asynchronous processing such as network processes.</p>
  
  <p>When calling 'showAlertDialog ()' from an external class, I want to call it without context. Is there a good way?</p>
  
  <pre><code>class SplashPage extends StatelessWidget implements SplashView {
    BuildContext _context;
    @override
    Widget build(BuildContext context) {
      this._context = context;
      ...
    }
  </code></pre>
  
  <p>I've considered the above method, but I'm worried about side issues.</p>
  
  <p>Help</p>
  
  <h2>My current code</h2>
  
  <pre><code>class SplashPage extends StatelessWidget implements SplashView {
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        backgroundColor: MyStoreColors.eats_white1_ffffff,
        body: Center(
          child: new SvgPicture.asset('assets/ic_splash.svg'),
        ),
      );
    }
  
    @override
    void showAlertDialog() {
  
      showDialog&lt;void&gt;(
        context: /*How to get context?*/,
        builder: (BuildContext context) {
          return AlertDialog(
            title: Text('Not in stock'),
            content: const Text('This item is no longer available'),
            actions: &lt;Widget&gt;[
              FlatButton(
                child: Text('Ok'),
                onPressed: () {
                  Navigator.of(context).pop();
                },
              ),
            ],
          );
        },
      );
    }
  
    @override
    void moveToHomeContainer() {
    }
  
    @override
    void moveToLoginContainer() {
    }
  }
  
  </code></pre>