Skip to content

Instantly share code, notes, and snippets.

@asavchuk
Last active December 20, 2020 09:09
Show Gist options
  • Save asavchuk/438c849955e12970e60ef05cd22d5317 to your computer and use it in GitHub Desktop.
Save asavchuk/438c849955e12970e60ef05cd22d5317 to your computer and use it in GitHub Desktop.
ep_19
import 'dart:async';
import 'package:firebase_auth/firebase_auth.dart';
class AuthService {
FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
final _controller = StreamController<String>();
Stream<String> get onAuthStateChanged {
User user = _firebaseAuth.currentUser;
_controller.add(user?.uid);
return _controller.stream;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment