title: How to TextField hide/show click on the text in flutter
body: <p>I have an Alert dialog in which have three option, I want to that when I click on the <code>text(Enter RC Number)</code> once the below <code>TextField</code> will be shown and again click on <code>text(Enter RC Number)</code> second-time the below <code>TextField</code> hide and (the below <code>TextField</code> will be hidden by default) how to do this please suggest to me.</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter/cupertino.dart';
  void main()=&gt; runApp(MyHomePages());
  
  class MyHomePages  extends StatelessWidget{
    @override
    Widget build(BuildContext context) {
      // TODO: implement build
      return MaterialApp(
        debugShowCheckedModeBanner: false,
        title: &quot;KYC Formm&quot;,
        theme: ThemeData(
          primarySwatch: Colors.green,
        ),
        home: MyHomePageDesign(title: &quot;Kyc form&quot;),
      );
    }
  }
  class MyHomePageDesign extends StatefulWidget {
    MyHomePageDesign({Key key, this.title}) : super(key: key);
  
    final String title;
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePageDesign&gt; {
    var _isVisible = false ;
    TextEditingController phoneController = new TextEditingController();
  
    @override
    void initState() {
      // TODO: implement initState
      super.initState();
      setState(() {
  
      });
    }
  
    _displayDialog(BuildContext context) async {
      return showDialog(
          barrierDismissible: true,
          context: context,
          builder: (context) {
            return AlertDialog(
              title: Text('Choose any one'),
              content: Column(
                mainAxisSize: MainAxisSize.min,
                children: &lt;Widget&gt;[
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Text(&quot;Capture Photo&quot;,
                      style: TextStyle(
                        fontSize: 20.0,
                      ),
                    ),
                  ),
                  SizedBox(height: 10.0,),
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Text(&quot;Pick Photo&quot;,
                      style: TextStyle(
                        fontSize: 20.0,
                      ),
                    ),
                  ),
                  SizedBox(height: 10.0,),
                  Align(
                    alignment: Alignment.centerLeft,
                    child: InkWell(
                      onTap: (){
                        setState(() {
  //                        _isVisible = !_isVisible;
  //                        if(_isVisible){
  //                          _isVisible=true;
  //                        }else{
  //                          _isVisible=false;
  //                        }
                        });
  
                      },
                      child: Text(&quot;Enter RC Number&quot;,
                        style: TextStyle(
                          fontSize: 20.0,
                        ),
                      ),
                    ),
                  ),
  
                  SizedBox(height: 10.0,),
                  Visibility(
                    visible: _isVisible,
                    child: Align(
                      alignment: Alignment.centerLeft,
                      child: Container(
                        width: 200.0,
                        height: 60.0,
                        padding: const EdgeInsets.only(top: 10.0, left: 0.0,bottom: 10.0,right: 0.0),
                        child: TextField(
                          decoration: InputDecoration(
                            border: OutlineInputBorder(),
                            labelText: 'Enter RC No',
                          ),
                          style: TextStyle(
                            color: Colors.red,
                            fontSize: 18.0,
                          ),
                        ),
                      ),
                    ),
                  ),
                  Align(
                    alignment: Alignment.centerRight,
                    child: new FlatButton(
                      child: new Text('OK',
                        style: TextStyle(
                            color: Colors.teal
                        ),),
                      onPressed: () {
                        Navigator.of(context).pop();
                      },
                    ),
                  )
                ],
  
              ),
            );
            // );
          });
    }
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text('Demo'),
        ),
        body: Center(
          child:Container(
            width: 160.0,
            height: 50.0,
            padding: const EdgeInsets.only(top: 0.0, left: 5.0,bottom: 10.0,right: 0.0),
            child: RaisedButton(
              color: Colors.green,
              child: Text('Open Dialog'),
              onPressed: () {
                _displayDialog(context);
              },
            ),
          ),
        ),
      );
    }
  }
  </code></pre>