title: getter called on null in flutter gives error screen
body: <p>I have a login and an update profile screen after the login. here I am setting the user profile in the <code>genesis</code> method. I am facing weired issue. most of the time I get the below screen where I do have the information for the user. the specific column is <code>gender</code> where it was called on null is the error.</p>
  
  <p><a href="https://i.stack.imgur.com/qajbc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qajbc.png" alt="enter image description here"></a></p>
  
  <pre class="lang-dart prettyprint-override"><code>
  //store user data
        _user = new UserModel(
          id: data['collection']['userData']['id'].toString(),
          name: data['collection']['userData']['name'],
          email: data['collection']['userData']['email'],
          phone: data['collection']['userData']['phone_number'].toString(),
          avatar: data['collection']['userData']['avatar'],
          age: data['collection']['userData']['age'].toString(),
          gender: data['collection']['userData']['gender'].toUpperCase().toString() ?? 'MALE',
          totalscore: 100,
          // totalscore: data['collection']['userData']['total_sessions_count'],
          totaldays: data['collection']['userData']['total_session_by_days_count'],
        );
  
  </code></pre>
  
  <p>and above is the code in <code>genesis</code> method which stores the data locally.</p>
  
  <p>in user <code>profile update screen</code> code is as following:</p>
  
  <pre class="lang-dart prettyprint-override"><code>
  Widget build(BuildContext context) {
       final userProvider =  Provider.of&lt;Genesis&gt;(context, listen: false);
       _user = userProvider.user;
       print('------------------------------------');
       print(_user);
       print('------------------------------------');
      if(_firsTime){
        setState(() {
          _gender = _user.gender.toUpperCase() ?? _gender;
          _nameController.text = _user.name;
          _emailController.text = _user.email;
          _ageController.text = _user.age;
          _phoneController.text = _user.phone;
          _avatar = _user.avatar ?? 'https://placehold.it/200x200';
          _firsTime = false;
        });
      }
  }
  
  what is the issue here ?
  
  
  </code></pre>