firebase_user_stream 0.1.0+4 firebase_user_stream: ^0.1.0+4 copied to clipboard
This package aims to provide a functionality missing from firebase_auth, which is to be able to reload user data from the server and get Stream updates with the new data.
import 'package:firebase_user_stream/firebase_user_stream.dart';
/// This example is just to show how can you use the library on your code. As
/// this library works very tightly with [FirebaseAuth] it's hard to make a
/// simple example, as we will need to add a sign-in or sign-out in the example
/// itself, which goes beyond the libraries' purposes.
void main() {
FirebaseUserReloader.onUserReloaded.listen((user) {
print('Reloaded: $user');
});
FirebaseUserReloader.onAuthStateChangedOrReloaded.listen((user) {
print('Reloaded or auth state changed: $user');
});
FirebaseUserReloader.reloadCurrentUser();
FirebaseUserReloader.reloadCurrentUser((user) => user.isEmailVerified);
}