title: Failed assertion: line 65 pos 15: 'visible != null': is not true
body: <p>I'm trying to get data from shared preferences, when data is <code>No Access</code> Some Menu Will Be Hidden.</p>
  
  <p>But I'm getting an error like this:</p>
  
  <blockquote>
    <p>I/flutter (15955): Another exception was thrown: 'package:flutter/src/widgets/visibility.dart': Failed assertion: line 65 pos 15: 'visible != null': is not true.</p>
  </blockquote>
  
  <p>Okay , may this is not made my app force close , but i always getting red screen just flicker if i will be open drawer</p>
  
  <blockquote>
    <p>NOTE : VIEW / HIDDEN WIDGET WORKING , JUST A PROBLEM IN 'VISIBLE != TRUE'</p>
  </blockquote>
  
  <p>Here is my code</p>
  
  <pre><code>///Widget for creating drawer menu in the sidebar.
  
  import 'package:flutter/material.dart';
  import 'package:flutter_ebudgeting/screens/login_page.dart';
  import 'package:flutter_ebudgeting/screens/aju/AjuScreen.dart';
  import 'package:flutter_ebudgeting/screens/proposal/ProposalScreen.dart';
  import 'package:shared_preferences/shared_preferences.dart';
  import 'package:eva_icons_flutter/eva_icons_flutter.dart';
  import 'package:rflutter_alert/rflutter_alert.dart';
  import 'package:overlay_support/overlay_support.dart';
  import 'package:flutter_ebudgeting/screens/profile/ProfileScreen.dart';
  
  List roleAju;
  
  class DrawerOnly extends StatefulWidget {
    @override
    _DrawerOnlyState createState() =&gt; _DrawerOnlyState();
  }
  
  class _DrawerOnlyState extends State&lt;DrawerOnly&gt; {
    bool menuAju;
    String nulled = "[No Access, No Access, No Access]";
  
    @override
    void initState() {
      super.initState();
      _loadMenuAju();
    }
  
    void _loadMenuAju() async {
      SharedPreferences pref = await SharedPreferences.getInstance();
      roleAju = (pref.getStringList('role_aju'));
      if (roleAju.toString() == nulled){
          setState((){
            menuAju = false;
          });
      }else{
          setState((){
            menuAju = true;
          });
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return new Drawer(
          child: new ListView(
        children: &lt;Widget&gt;[
          new DrawerHeader(
            child: new Text("Menu"),
            decoration: new BoxDecoration(
              gradient: LinearGradient(
                  colors: [Colors.lightBlueAccent, Colors.lightGreenAccent]),
            ),
          ),
  
          ///Menu to go to Profile
          new ListTile(
            leading: Icon(Icons.person_outline),
            title: new Text("Profile"),
            onTap: () {
              Navigator.pop(context);
              Navigator.push(
                  context,
                  new MaterialPageRoute(
                      builder: (context) =&gt; new ProfileScreen()));
            },
          ),
  
          ///Menu to go to Proposal List
          new ListTile(
            leading: Icon(Icons.view_list),
            title: new Text("Proposal List"),
            onTap: () {
              Navigator.pop(context);
              Navigator.push(
                  context,
                  new MaterialPageRoute(
                      builder: (context) =&gt; new ProposalScreen()));
            },
          ),
  
          ///Menu to go to AJU List
          new Visibility(
            visible: menuAju,
            child: ListTile(
              leading: Icon(Icons.view_list),
              title: new Text("Aju List"),
              onTap: (){
                Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context) =&gt; new AjuScreen()));
              },
            )
          ),
  
          ///Menu to log out and return to login page.
          new ListTile(
            leading: Icon(EvaIcons.logOut),
            title: new Text("Sign Out"),
            onTap: () {
              Alert(
                context: context,
                type: AlertType.warning,
                title: "SIGN OUT CONFIRMATION",
                desc: "Are you sure you want to sign out?",
                buttons: [
                  DialogButton(
                      child: Text(
                        "NO",
                        style: TextStyle(color: Colors.white, fontSize: 20),
                      ),
                      onPressed: () =&gt; Navigator.pop(context),
                      color: Colors.red),
                  DialogButton(
                    child: Text(
                      "YES",
                      style: TextStyle(color: Colors.white, fontSize: 20),
                    ),
                    onPressed: () async {
                      SharedPreferences pref =
                          await SharedPreferences.getInstance();
                      pref.remove("authorization");
                      pref.remove("is_login");
                      Navigator.pushReplacement(
                          context,
                          MaterialPageRoute(
                              builder: (BuildContext context) =&gt;
                                  new LoginPage()));
                      showSimpleNotification(
                        Text("Successfully signed out."),
                        background: Colors.green,
                      );
                    },
                    gradient: LinearGradient(
                        colors: [Colors.greenAccent, Colors.green]),
                  )
                ],
              ).show();
            },
          ),
        ],
      ));
    }
  }
  
  </code></pre>