Skip to content

Instantly share code, notes, and snippets.

@felangel
Created August 4, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felangel/ca302b01b8ef7126120479ce7207de2f to your computer and use it in GitHub Desktop.
Save felangel/ca302b01b8ef7126120479ce7207de2f to your computer and use it in GitHub Desktop.
[flutter_firestore_todos] authentication states
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