Get immediate access to this and 4,000+ other videos and books.

Take your career further with a raywenderlich.com Pro subscription. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it’s simply the best investment you can make in your development career.

Add a Sign-In Screen Pro

This video was last updated on Aug 30 2022

FlutterFire UI contains tools that help you create your user interface that requires Firebase integration. You will create a Sign-In screen and connect it to Firebase Authentication, then add a logo to customize the screen.

Contributors

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.

OK, we are now ready to start using Firebase in our app.

import 'package:firebase_core/firebase_core.dart'; 
import 'firebase_options.dart'; 
WidgetsFlutterBinding.ensureInitialized(); 
Future<void> main() async { 
  WidgetsFlutterBinding.ensureInitialized(); 
  await Firebase.initializeApp( 
    options: DefaultFirebaseOptions.currentPlatform, 
  ); 
  runApp(const MyApp()); 
} 
import 'package:firebase_auth/firebase_auth.dart'; 
return StreamBuilder<User?>( 
      stream: FirebaseAuth.instance.authStateChanges(), 
      builder: (context, snapshot) { 
        return Container(); 
      }, 
flutter.minSdkVersion=21 
minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger() 
if (!snapshot.hasData) { 
  return SignInScreen(); 
} 
providerConfigs: [ 
  EmailProviderConfiguration(), 
], 
// User is not logged in 
        if (!snapshot.hasData) { 
          return const SignInScreen( 
            providerConfigs: [ 
              EmailProviderConfiguration(), 
            ], 
          ); 
        } 
        return const ActivitiesScreen(); 

Reviews

Comments