feat(authentication): remove session wrapper for AuthenticationSession
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ class ExampleAuthenticationCubit extends AuthenticationCubit<int> {
|
||||
}
|
||||
|
||||
@override
|
||||
FutureOrResult<int?> onSignInFromCache(SessionWrapper<int> wrapper) {
|
||||
FutureOrResult<int?> onSignInFromCache(AuthenticationSession<int> session) {
|
||||
print('onSignInFromCache');
|
||||
|
||||
return const Ok(1);
|
||||
|
||||
+3
-4
@@ -30,8 +30,7 @@ class HomePage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
'Home | ${context.account<AuthenticationCubit<int>, int>()?.email}'),
|
||||
title: Text('Home | ${context.watchAccount<int>()?.email}'),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
@@ -44,8 +43,8 @@ class HomePage extends StatelessWidget {
|
||||
child: ListView(
|
||||
children: [
|
||||
AuthenticationBuilder<int>(
|
||||
authenticated: (context, sessionWrapper) => Text(
|
||||
'Logged as ${sessionWrapper.session?.account.email} | GeneratedId is ${sessionWrapper.session?.data}'),
|
||||
authenticated: (context, session) => Text(
|
||||
'Logged as ${session.account?.email} | GeneratedId is ${session.data}'),
|
||||
unauthenticated: (context) =>
|
||||
const Text('Not logged (unauthenticated)'),
|
||||
unknown: (context) => const Text('Not logged (unknown)'),
|
||||
|
||||
Reference in New Issue
Block a user