login page in flutter using firebase code example

Example 1: getting uid of user firebase flutter

final FirebaseUser user = await auth.currentUser();
final userid = user.uid;

Example 2: how to log data to the flutter console ?

import 'package:flutter/foundation.dart';

debugPrint('movieTitle: $movieTitle');

Example 3: sigup and sign out using firebase auth in flutter

Future<Null> _signOut() async {
    await _auth.signOut();
    this.setState(() {
      isLoading = false;
    });
    Navigator.of(context).pushAndRemoveUntil(
        MaterialPageRoute(builder: (context) => MyApp()),
        (Route<dynamic> route) => false);
  }

Tags:

Dart Example