Created
August 4, 2019 18:47
-
-
Save felangel/ca302b01b8ef7126120479ce7207de2f to your computer and use it in GitHub Desktop.
[flutter_firestore_todos] authentication states
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:equatable/equatable.dart'; | |
import 'package:meta/meta.dart'; | |
@immutable | |
abstract class AuthenticationState extends Equatable { | |
AuthenticationState([List props = const []]) : super(props); | |
} | |
class Uninitialized extends AuthenticationState { | |
@override | |
String toString() => 'Uninitialized'; | |
} | |
class Authenticated extends AuthenticationState { | |
final String userId; | |
Authenticated(this.userId) : super([userId]); | |
@override | |
String toString() => 'Authenticated { userId: $userId }'; | |
} | |
class Unauthenticated extends AuthenticationState { | |
@override | |
String toString() => 'Unauthenticated'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment