title: Error: Property 'uid' cannot be accessed on 'User?' because it is potentially null
body: <p>Hi new to flutter and firebase what i am tried to make is simple signup new user then add it's information to cloud firestore with custom id and adding subcollections names &quot;notifications&quot;
  here sample of the code ..</p>
  <pre><code>final _auth = FirebaseAuth.instance;
    final _ref = FirebaseFirestore.instance;
    final userCollections = FirebaseFirestore.instance.collection(&quot;users&quot;);
    Future&lt;void&gt; SignupToColud(
        {@required String name = &quot;&quot;,
        @required String email = &quot;&quot;,
        @required String pass = &quot;&quot;}) async {
      try {
        await _auth
            .createUserWithEmailAndPassword(email: email, password: pass)
            .then((value) {
          String userId = value.user.uid;
          if (userId != null) {
            userCollections.doc(userId).set({'name': name, 'email': email});
            userCollections
                .doc(userId)
                .collection(&quot;notifications&quot;)
                .add({'txt': 'welcome you registered as new user succefully'});
          } else {
            throw Error();
          }
        });
        // first sign up to cloud if success
  
        //then add to users collections
      } catch (e) {
        print(e.toString());
      }
    }
  </code></pre>
  <code>
  <p>i got this error !!</p>
  <pre><code>    lib/Sign_up.dart:24:36: Error: Property 'uid' cannot be accessed on 'User?' because it is potentially null.
   - 'User' is from 'package:firebase_auth/firebase_auth.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-1.2.0/lib/firebase_auth.dart').
  Try accessing using ?. instead.
          String userId = value.user.uid;
                                 ^^^
  </code></pre>
  <p>this is pubspec.yaml file information
  environment:
  sdk: &quot;&gt;=2.12.0 &lt;3.0.0&quot;</p>
  <p>dependencies:</p>
  <pre>  flutter:
      sdk: flutter
    cupertino_icons: ^1.0.0
    firebase_core: ^1.2.0
    cloud_functions: ^1.1.0
    cloud_firestore: ^2.2.0
    firebase_storage: ^8.1.0
    firebase_auth: ^1.2.0
  </code></pre>
  <p>i really have no idea with the problem and how to solve it :(</p>