title: How To Read ModalRoute.of(context).settings.arguments Properly?
body: <p>I'm confused with flutter, when I want to read arguments from statefulwidget (initstate) and access it into widget build, the variable is still null. how to read it properly? my code is bellow :</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:caritokoonline_v2/components/ResultForm.dart';
  import 'package:caritokoonline_v2/podo/SearchBarangRequest.dart';
  
  class ResultBarangActivity extends StatefulWidget {
    SearchBarangRequest searchBarangRequest;
  
    @override
    _ResultBarangActivityState createState() =&gt; _ResultBarangActivityState();
  }
  
  class _ResultBarangActivityState extends State&lt;ResultBarangActivity&gt; {
    final _scaffoldKey = GlobalKey&lt;ScaffoldState&gt;();
  
  
    @override
    void initState(){
  
  
      Future.delayed(Duration.zero,(){
        setState(() {
          widget.searchBarangRequest = ModalRoute.of(context).settings.arguments;
          print(widget.searchBarangRequest.keyword);
        });
      });
  
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
      if (widget.searchBarangRequest == null) return Scaffold(); //this line is always executed
  
      return ResultForm(
        scaffoldKey: _scaffoldKey,
        title: widget.searchBarangRequest.keyword,
        subTitle: widget.searchBarangRequest.hargaRange.toString(),);
    }
  }
  </code></pre>
  
  <p>Thank!</p>