title: I wanted to create a search bar, but there are some errors. Code is as below
body: <pre><code>class _MyHomePageState extends State&lt;MyHomePage&gt; {
    SearchBar searchBar;
  
    AppBar buildAppBar(BuildContext context) {
      return new AppBar(
        title: new Text('My Home Page'),
        actions: [searchBar.getSearchAction(context)]
      );
    }  
  
    _MyHomePageState() {
      searchBar = new SearchBar(
        inBar: false,
        setState: setState,
        onSubmitted: print,
        buildDefaultAppBar: buildAppBar
      );
    }
  
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: searchBar.build(context)
      );
    }
  }
  </code></pre>
  <p>Errors: Classes can only extend other classes. The name 'MyHomePage' isn't a type so it can't be used as a type argument. Classes can't be declared inside other classes. Expected to find '}'. The declaration '_MyHomePageState' isn't referenced.</p>