title: Error: Undefined name 'isRememberMe' Error: Required named parameter 'onChanged' must be provided
body: <p>When I'm trying to define isRememberme widget, some errors occurred. I'm trying to build a login app UI using flutter and android studio. I'm very new to this and struggling to find the error. I have highlighted the code that gives me error.</p>
  <pre><code>bool isRememberMe =false; //
  </code></pre>
  <pre><code>class LoginScreen extends StatefulWidget {
    @override
    _LoginScreenState createState() =&gt; _LoginScreenState();
  }
  
  Widget buildEmail() {
    return Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: &lt;Widget&gt;[
          Text(
            'Email',
            style: TextStyle(
                color: Colors.white,
                fontSize: 16,
                fontWeight:
                FontWeight.bold
            ),
          ),
          SizedBox(height: 10),
          Container(
              alignment: Alignment.centerLeft,
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(10),
                  boxShadow: [
                    BoxShadow(
                        color: Colors.black26,
                        blurRadius: 6,
                        offset: Offset(0, 2)
                    )
                  ]
              ),
  
              height: 60,
              child: TextField(
                keyboardType: TextInputType.emailAddress,
                style: TextStyle(color: Colors.black87),
                decoration: InputDecoration(
                    border: InputBorder.none,
                    contentPadding: EdgeInsets.only(top: 14),
                    prefixIcon: Icon(
                      Icons.email,
                      color: Color(0xff5ac18e),
                    ),
                    hintText: 'Email',
                    hintStyle: TextStyle(color: Colors.black38)),
              )
          )
        ],
    );
  }
  
  ///////////////////////////////
  
  Widget buildPassword() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: &lt;Widget&gt;[
        Text(
          'Password',
          style: TextStyle(
              color: Colors.white,
              fontSize: 16,
              fontWeight:
              FontWeight.bold
          ),
        ),
        SizedBox(height: 10),
        Container(
            alignment: Alignment.centerLeft,
            decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(10),
                boxShadow: [
                  BoxShadow(
                      color: Colors.black26,
                      blurRadius: 6,
                      offset: Offset(0, 2)
                  )
                ]
            ),
  
            height: 60,
            child: TextField(
              obscureText: true,
              style: TextStyle(color: Colors.black87),
              decoration: InputDecoration(
                  border: InputBorder.none,
                  contentPadding: EdgeInsets.only(top: 14),
                  prefixIcon: Icon(
                    Icons.lock,
                    color: Color(0xff5ac18e),
                  ),
                  hintText: 'Password',
                  hintStyle: TextStyle(color: Colors.black38)),
            )
        )
      ],
    );
  }
  
  Widget buildForgotPassBtn(){
  
    return Container(
      alignment: Alignment.centerRight,
      child: TextButton(
        onPressed: () =&gt; print(&quot;Forget Password pressed&quot;),
       // padding: EdgeInsets.only(right:0),
        child: Text(
          'Forgot Passsword?',
          style: TextStyle(
            color: Colors.white,
            fontWeight : FontWeight.bold
          ),
        ),
      ),
    );
  }
  
  **Widget buildRememberCb(){
    return Container(
      height: 20,
      child: Row(
        children: &lt;Widget&gt;[
         Theme(
            data: ThemeData(unselectedWidgetColor :Colors.white),
            child: Checkbox(
              value: isRememberMe,
               ),
               )
              ],
            ),
          )
  }
  class _LoginScreenState extends State&lt;LoginScreen&gt; {
    bool isRememberMe =false;**
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: AnnotatedRegion&lt;SystemUiOverlayStyle&gt;(
          value: SystemUiOverlayStyle.light,
          child: GestureDetector(
            child: Stack(
              children: &lt;Widget&gt;[
                Container(
                  height: double.infinity,
                  width: double.infinity,
                  decoration: BoxDecoration(
                      gradient: LinearGradient(
                          begin: Alignment.topCenter,
                          end: Alignment.bottomCenter,
                          colors: [
                            Color(0x665ac18e),
                            Color(0x995ac18e),
                            Color(0xcc5ac18e),
                            Color(0xff5ac18e),
                          ]
                      )
                  ),
  
                  child: SingleChildScrollView(
                    physics: AlwaysScrollableScrollPhysics(),
                    padding: EdgeInsets.symmetric(
                      horizontal: 25,
                      vertical: 120,
  
                    ),
  
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: &lt;Widget&gt;[
                        Text(
                          'Sign In',
                          style: TextStyle(
                              color: Colors.white,
                              fontSize: 40,
                              fontWeight: FontWeight.bold),
                        ),
                        SizedBox(height: 50),
                        buildEmail(),
                        SizedBox(height: 20),
                        buildPassword(),
                        buildForgotPassBtn(),
                        buildRememberCb(),
                      ],
                    ),
                  ),
  
                ),
              ],
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/yjhJh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yjhJh.png" alt="enter image description here" /></a></p>