title: How to keep the widget's state in Scaffold.drawer in Flutter?
body: <p>I want to keep the widget's state in <code>Scaffold.drawer</code>. <code>The Scaffold.drawer</code> is a custom widget, which has a <strong>RaiseButton</strong> in it.
  When click the button, the text in the button changed.
  But when the drawer is closed, and reopen the drawer, the changed text is reseted.</p>
  
  <p>I have use " with <code>AutomaticKeepAliveClientMixin&lt;&gt;</code> " in my custom <em>Drawer</em>, but it does't work.</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        home: MyHomePage(),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key}) : super(key: key);
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text("Flutter Demo"),
        ),
        drawer: Drawer(child: CustomDrawer(),),
        body: Center(
          child: Text("Flutter Demo"),
        ),
      );
    }
  }
  
  class CustomDrawer extends StatefulWidget {
    @override
    State&lt;StatefulWidget&gt; createState() {
      return _CustomDrawerState();
    }
  }
  
  class _CustomDrawerState extends State&lt;CustomDrawer&gt; with AutomaticKeepAliveClientMixin&lt;CustomDrawer&gt; {
  
    String btnText = "Click!";
  
    @override
    bool get wantKeepAlive =&gt; true;
  
    @override
    Widget build(BuildContext context) {
      super.build(context);
      return Center(
        child: RaisedButton(onPressed: () {
          setState(() {
            btnText = "Clicked!!";
          });
        }, child: Text(btnText),),
      );
    }
  
  }
  </code></pre>
  
  <p>I expect the widget's state can keep, even if the Drawer is closed.</p>