diff --git a/flutter-ory-network/.gitignore b/flutter-ory-network/.gitignore
index 189b569..eb17452 100644
--- a/flutter-ory-network/.gitignore
+++ b/flutter-ory-network/.gitignore
@@ -32,6 +32,51 @@ migrate_working_dir/
.pub/
/build/
+# Android related
+**/android/build/
+**/android/**/gradle-wrapper.jar
+**/android/.gradle
+**/android/captures/
+**/android/gradlew
+**/android/gradlew.bat
+**/android/local.properties
+**/android/**/GeneratedPluginRegistrant.java
+
+# iOS/XCode related
+**/ios/**/*.mode1v3
+**/ios/**/*.mode2v3
+**/ios/**/*.moved-aside
+**/ios/**/*.pbxuser
+**/ios/**/*.perspectivev3
+**/ios/**/*sync/
+**/ios/**/.sconsign.dblite
+**/ios/**/.tags*
+**/ios/**/.vagrant/
+**/ios/**/DerivedData/
+**/ios/**/Icon?
+**/ios/**/Pods/
+**/ios/**/.symlinks/
+**/ios/**/profile
+**/ios/**/xcuserdata
+**/ios/.generated/
+**/ios/Flutter/App.framework
+**/ios/Flutter/Flutter.framework
+**/ios/Flutter/Flutter.podspec
+**/ios/Flutter/Generated.xcconfig
+**/ios/Flutter/app.flx
+**/ios/Flutter/app.zip
+**/ios/Flutter/flutter_assets/
+**/ios/Flutter/flutter_export_environment.sh
+**/ios/ServiceDefinitions.json
+**/ios/Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!**/ios/**/default.mode1v3
+!**/ios/**/default.mode2v3
+!**/ios/**/default.pbxuser
+!**/ios/**/default.perspectivev3
+!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
+
# Symbolication related
app.*.symbols
@@ -43,4 +88,5 @@ app.*.map.json
/android/app/profile
/android/app/release
+# Environmental variables
.env
diff --git a/flutter-ory-network/README.md b/flutter-ory-network/README.md
index bfe6210..d3acb7d 100644
--- a/flutter-ory-network/README.md
+++ b/flutter-ory-network/README.md
@@ -20,6 +20,48 @@ Create .env file with your project url in the root folder of the Flutter app
ORY_BASE_URL=https://{your-project-slug}.projects.oryapis.com
```
+### Google Sign In
+
+If you use Google Sign In on Android, add following variable to .env file
+
+```env
+WEB_CLIENT_ID={web-client-id}.apps.googleusercontent.com
+```
+
+If you use Google Sign In on iOS, add following variable to .env file
+
+```env
+
+IOS_CLIENT_ID={ios-client-id}.apps.googleusercontent.com
+```
+
+Additionally, add iOS URL scheme to Info.plist. It can be found in additional
+information of your iOS Client ID.
+
+```xml
+CFBundleURLTypes
+
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLSchemes
+
+
+ IOS_URL_SCHEME
+
+
+
+```
+
+For more information, see
+[Google Integration Docs](https://www.ory.sh/docs/kratos/social-signin/google).
+
+### Apple Sign In
+
+To configure Apple Sign In on IOS, see
+[Apple Integration Docs](https://www.ory.sh/docs/kratos/social-signin/apple).\
+To configure Apple Sign In on Android, see [Social sign-in for native and mobile apps ](https://www.ory.sh/docs/kratos/social-signin/native-apps).
+
### Run locally
1. Install dependencies from `pubspec.yaml`
diff --git a/flutter-ory-network/android/app/build.gradle b/flutter-ory-network/android/app/build.gradle
index 9410838..cee1d87 100644
--- a/flutter-ory-network/android/app/build.gradle
+++ b/flutter-ory-network/android/app/build.gradle
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- namespace "com.example.ory_network_flutter"
+ namespace "sh.ory.flutter_ory_network"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
@@ -45,10 +45,10 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.example.ory_network_flutter"
+ applicationId "sh.ory.flutter_ory_network"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
- minSdkVersion 18
+ minSdkVersion 19
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
diff --git a/flutter-ory-network/android/app/src/main/AndroidManifest.xml b/flutter-ory-network/android/app/src/main/AndroidManifest.xml
index 097b25f..aff483c 100644
--- a/flutter-ory-network/android/app/src/main/AndroidManifest.xml
+++ b/flutter-ory-network/android/app/src/main/AndroidManifest.xml
@@ -1,8 +1,10 @@
+
+ android:icon="@mipmap/ic_launcher"
+ android:usesCleartextTraffic="true">
+ android:name="io.flutter.embedding.android.NormalTheme"
+ android:resource="@style/NormalTheme" />
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IOS_URL_SCHEME
+
+
+
CFBundleVersion
$(FLUTTER_BUILD_NUMBER)
LSRequiresIPhoneOS
diff --git a/flutter-ory-network/ios/Runner/Runner.entitlements b/flutter-ory-network/ios/Runner/Runner.entitlements
new file mode 100644
index 0000000..a812db5
--- /dev/null
+++ b/flutter-ory-network/ios/Runner/Runner.entitlements
@@ -0,0 +1,10 @@
+
+
+
+
+ com.apple.developer.applesignin
+
+ Default
+
+
+
diff --git a/flutter-ory-network/lib/blocs/auth/auth_bloc.dart b/flutter-ory-network/lib/blocs/auth/auth_bloc.dart
index 6d49f03..4ca09ad 100644
--- a/flutter-ory-network/lib/blocs/auth/auth_bloc.dart
+++ b/flutter-ory-network/lib/blocs/auth/auth_bloc.dart
@@ -16,13 +16,32 @@ part 'auth_bloc.freezed.dart';
class AuthBloc extends Bloc {
final AuthRepository repository;
AuthBloc({required this.repository})
- : super(const AuthState(status: AuthStatus.uninitialized)) {
+ : super(const AuthState.uninitialized()) {
on(_onGetCurrentSessionInformation);
+ on(_onRequireLocationChange);
+ on(_onAddSession);
on(_onChangeAuthStatus);
on(_onLogOut);
}
+ _onRequireLocationChange(
+ RequireLocationChange event, Emitter emit) {
+ emit(AuthState.locationChangeRequired(url: event.url));
+ }
+
+ _onAddSession(AddSession event, Emitter emit) {
+ emit(AuthState.authenticated(session: event.session));
+ }
+
_onChangeAuthStatus(ChangeAuthStatus event, Emitter emit) {
+ switch (event.status) {
+ case AuthStatus.unauthenticated:
+ emit(const AuthState.unauthenticated());
+ case AuthStatus.aal2Requested:
+ emit(const AuthState.aal2Requested());
+ default:
+ emit(state);
+ }
emit(state.copyWith(status: event.status, isLoading: false));
}
@@ -33,16 +52,11 @@ class AuthBloc extends Bloc {
final session = await repository.getCurrentSessionInformation();
- emit(state.copyWith(
- isLoading: false,
- status: AuthStatus.authenticated,
- session: session));
+ emit(AuthState.authenticated(session: session));
} on UnauthorizedException catch (_) {
- emit(state.copyWith(
- status: AuthStatus.unauthenticated, session: null, isLoading: false));
+ emit(const AuthState.unauthenticated());
} on TwoFactorAuthRequiredException catch (_) {
- emit(state.copyWith(
- isLoading: false, session: null, status: AuthStatus.aal2Requested));
+ emit(const AuthState.aal2Requested());
} on UnknownException catch (e) {
emit(state.copyWith(isLoading: false, errorMessage: e.message));
} catch (_) {
@@ -56,11 +70,9 @@ class AuthBloc extends Bloc {
await repository.logout();
- emit(state.copyWith(
- isLoading: false, status: AuthStatus.unauthenticated, session: null));
+ emit(const AuthState.unauthenticated());
} on UnauthorizedException catch (_) {
- emit(state.copyWith(
- status: AuthStatus.unauthenticated, session: null, isLoading: false));
+ emit(const AuthState.unauthenticated());
} on UnknownException catch (e) {
emit(state.copyWith(isLoading: false, errorMessage: e.message));
} catch (_) {
diff --git a/flutter-ory-network/lib/blocs/auth/auth_bloc.freezed.dart b/flutter-ory-network/lib/blocs/auth/auth_bloc.freezed.dart
index c9fb075..d9c8dbd 100644
--- a/flutter-ory-network/lib/blocs/auth/auth_bloc.freezed.dart
+++ b/flutter-ory-network/lib/blocs/auth/auth_bloc.freezed.dart
@@ -20,9 +20,89 @@ final _privateConstructorUsedError = UnsupportedError(
/// @nodoc
mixin _$AuthState {
AuthStatus get status => throw _privateConstructorUsedError;
- Session? get session => throw _privateConstructorUsedError;
bool get isLoading => throw _privateConstructorUsedError;
String? get errorMessage => throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ uninitialized,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ unauthenticated,
+ required TResult Function(AuthStatus status, Session session,
+ bool isLoading, String? errorMessage)
+ authenticated,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ aal2Requested,
+ required TResult Function(
+ AuthStatus status, String url, bool isLoading, String? errorMessage)
+ locationChangeRequired,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult? Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult? Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ required TResult orElse(),
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthUninitialized value) uninitialized,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(Aal2Requested value) aal2Requested,
+ required TResult Function(LocationChangeRequired value)
+ locationChangeRequired,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthUninitialized value)? uninitialized,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(Aal2Requested value)? aal2Requested,
+ TResult? Function(LocationChangeRequired value)? locationChangeRequired,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthUninitialized value)? uninitialized,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(Aal2Requested value)? aal2Requested,
+ TResult Function(LocationChangeRequired value)? locationChangeRequired,
+ required TResult orElse(),
+ }) =>
+ throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$AuthStateCopyWith get copyWith =>
@@ -34,11 +114,7 @@ abstract class $AuthStateCopyWith<$Res> {
factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) =
_$AuthStateCopyWithImpl<$Res, AuthState>;
@useResult
- $Res call(
- {AuthStatus status,
- Session? session,
- bool isLoading,
- String? errorMessage});
+ $Res call({AuthStatus status, bool isLoading, String? errorMessage});
}
/// @nodoc
@@ -55,7 +131,6 @@ class _$AuthStateCopyWithImpl<$Res, $Val extends AuthState>
@override
$Res call({
Object? status = null,
- Object? session = freezed,
Object? isLoading = null,
Object? errorMessage = freezed,
}) {
@@ -64,10 +139,6 @@ class _$AuthStateCopyWithImpl<$Res, $Val extends AuthState>
? _value.status
: status // ignore: cast_nullable_to_non_nullable
as AuthStatus,
- session: freezed == session
- ? _value.session
- : session // ignore: cast_nullable_to_non_nullable
- as Session?,
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
@@ -81,44 +152,467 @@ class _$AuthStateCopyWithImpl<$Res, $Val extends AuthState>
}
/// @nodoc
-abstract class _$$_AuthStateCopyWith<$Res> implements $AuthStateCopyWith<$Res> {
- factory _$$_AuthStateCopyWith(
- _$_AuthState value, $Res Function(_$_AuthState) then) =
- __$$_AuthStateCopyWithImpl<$Res>;
+abstract class _$$AuthUninitializedImplCopyWith<$Res>
+ implements $AuthStateCopyWith<$Res> {
+ factory _$$AuthUninitializedImplCopyWith(_$AuthUninitializedImpl value,
+ $Res Function(_$AuthUninitializedImpl) then) =
+ __$$AuthUninitializedImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call({AuthStatus status, bool isLoading, String? errorMessage});
+}
+
+/// @nodoc
+class __$$AuthUninitializedImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$AuthUninitializedImpl>
+ implements _$$AuthUninitializedImplCopyWith<$Res> {
+ __$$AuthUninitializedImplCopyWithImpl(_$AuthUninitializedImpl _value,
+ $Res Function(_$AuthUninitializedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? status = null,
+ Object? isLoading = null,
+ Object? errorMessage = freezed,
+ }) {
+ return _then(_$AuthUninitializedImpl(
+ status: null == status
+ ? _value.status
+ : status // ignore: cast_nullable_to_non_nullable
+ as AuthStatus,
+ isLoading: null == isLoading
+ ? _value.isLoading
+ : isLoading // ignore: cast_nullable_to_non_nullable
+ as bool,
+ errorMessage: freezed == errorMessage
+ ? _value.errorMessage
+ : errorMessage // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$AuthUninitializedImpl implements AuthUninitialized {
+ const _$AuthUninitializedImpl(
+ {this.status = AuthStatus.uninitialized,
+ this.isLoading = false,
+ this.errorMessage});
+
+ @override
+ @JsonKey()
+ final AuthStatus status;
+ @override
+ @JsonKey()
+ final bool isLoading;
+ @override
+ final String? errorMessage;
+
+ @override
+ String toString() {
+ return 'AuthState.uninitialized(status: $status, isLoading: $isLoading, errorMessage: $errorMessage)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthUninitializedImpl &&
+ (identical(other.status, status) || other.status == status) &&
+ (identical(other.isLoading, isLoading) ||
+ other.isLoading == isLoading) &&
+ (identical(other.errorMessage, errorMessage) ||
+ other.errorMessage == errorMessage));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, status, isLoading, errorMessage);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$AuthUninitializedImplCopyWith<_$AuthUninitializedImpl> get copyWith =>
+ __$$AuthUninitializedImplCopyWithImpl<_$AuthUninitializedImpl>(
+ this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ uninitialized,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ unauthenticated,
+ required TResult Function(AuthStatus status, Session session,
+ bool isLoading, String? errorMessage)
+ authenticated,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ aal2Requested,
+ required TResult Function(
+ AuthStatus status, String url, bool isLoading, String? errorMessage)
+ locationChangeRequired,
+ }) {
+ return uninitialized(status, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult? Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult? Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ }) {
+ return uninitialized?.call(status, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (uninitialized != null) {
+ return uninitialized(status, isLoading, errorMessage);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthUninitialized value) uninitialized,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(Aal2Requested value) aal2Requested,
+ required TResult Function(LocationChangeRequired value)
+ locationChangeRequired,
+ }) {
+ return uninitialized(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthUninitialized value)? uninitialized,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(Aal2Requested value)? aal2Requested,
+ TResult? Function(LocationChangeRequired value)? locationChangeRequired,
+ }) {
+ return uninitialized?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthUninitialized value)? uninitialized,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(Aal2Requested value)? aal2Requested,
+ TResult Function(LocationChangeRequired value)? locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (uninitialized != null) {
+ return uninitialized(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthUninitialized implements AuthState {
+ const factory AuthUninitialized(
+ {final AuthStatus status,
+ final bool isLoading,
+ final String? errorMessage}) = _$AuthUninitializedImpl;
+
+ @override
+ AuthStatus get status;
+ @override
+ bool get isLoading;
+ @override
+ String? get errorMessage;
+ @override
+ @JsonKey(ignore: true)
+ _$$AuthUninitializedImplCopyWith<_$AuthUninitializedImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$AuthUnauthenticatedImplCopyWith<$Res>
+ implements $AuthStateCopyWith<$Res> {
+ factory _$$AuthUnauthenticatedImplCopyWith(_$AuthUnauthenticatedImpl value,
+ $Res Function(_$AuthUnauthenticatedImpl) then) =
+ __$$AuthUnauthenticatedImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call({AuthStatus status, bool isLoading, String? errorMessage});
+}
+
+/// @nodoc
+class __$$AuthUnauthenticatedImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$AuthUnauthenticatedImpl>
+ implements _$$AuthUnauthenticatedImplCopyWith<$Res> {
+ __$$AuthUnauthenticatedImplCopyWithImpl(_$AuthUnauthenticatedImpl _value,
+ $Res Function(_$AuthUnauthenticatedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? status = null,
+ Object? isLoading = null,
+ Object? errorMessage = freezed,
+ }) {
+ return _then(_$AuthUnauthenticatedImpl(
+ status: null == status
+ ? _value.status
+ : status // ignore: cast_nullable_to_non_nullable
+ as AuthStatus,
+ isLoading: null == isLoading
+ ? _value.isLoading
+ : isLoading // ignore: cast_nullable_to_non_nullable
+ as bool,
+ errorMessage: freezed == errorMessage
+ ? _value.errorMessage
+ : errorMessage // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$AuthUnauthenticatedImpl implements AuthUnauthenticated {
+ const _$AuthUnauthenticatedImpl(
+ {this.status = AuthStatus.unauthenticated,
+ this.isLoading = false,
+ this.errorMessage});
+
+ @override
+ @JsonKey()
+ final AuthStatus status;
+ @override
+ @JsonKey()
+ final bool isLoading;
+ @override
+ final String? errorMessage;
+
+ @override
+ String toString() {
+ return 'AuthState.unauthenticated(status: $status, isLoading: $isLoading, errorMessage: $errorMessage)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthUnauthenticatedImpl &&
+ (identical(other.status, status) || other.status == status) &&
+ (identical(other.isLoading, isLoading) ||
+ other.isLoading == isLoading) &&
+ (identical(other.errorMessage, errorMessage) ||
+ other.errorMessage == errorMessage));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, status, isLoading, errorMessage);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$AuthUnauthenticatedImplCopyWith<_$AuthUnauthenticatedImpl> get copyWith =>
+ __$$AuthUnauthenticatedImplCopyWithImpl<_$AuthUnauthenticatedImpl>(
+ this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ uninitialized,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ unauthenticated,
+ required TResult Function(AuthStatus status, Session session,
+ bool isLoading, String? errorMessage)
+ authenticated,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ aal2Requested,
+ required TResult Function(
+ AuthStatus status, String url, bool isLoading, String? errorMessage)
+ locationChangeRequired,
+ }) {
+ return unauthenticated(status, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult? Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult? Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ }) {
+ return unauthenticated?.call(status, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (unauthenticated != null) {
+ return unauthenticated(status, isLoading, errorMessage);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthUninitialized value) uninitialized,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(Aal2Requested value) aal2Requested,
+ required TResult Function(LocationChangeRequired value)
+ locationChangeRequired,
+ }) {
+ return unauthenticated(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthUninitialized value)? uninitialized,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(Aal2Requested value)? aal2Requested,
+ TResult? Function(LocationChangeRequired value)? locationChangeRequired,
+ }) {
+ return unauthenticated?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthUninitialized value)? uninitialized,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(Aal2Requested value)? aal2Requested,
+ TResult Function(LocationChangeRequired value)? locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (unauthenticated != null) {
+ return unauthenticated(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthUnauthenticated implements AuthState {
+ const factory AuthUnauthenticated(
+ {final AuthStatus status,
+ final bool isLoading,
+ final String? errorMessage}) = _$AuthUnauthenticatedImpl;
+
+ @override
+ AuthStatus get status;
+ @override
+ bool get isLoading;
+ @override
+ String? get errorMessage;
+ @override
+ @JsonKey(ignore: true)
+ _$$AuthUnauthenticatedImplCopyWith<_$AuthUnauthenticatedImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$AuthAuthenticatedImplCopyWith<$Res>
+ implements $AuthStateCopyWith<$Res> {
+ factory _$$AuthAuthenticatedImplCopyWith(_$AuthAuthenticatedImpl value,
+ $Res Function(_$AuthAuthenticatedImpl) then) =
+ __$$AuthAuthenticatedImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{AuthStatus status,
- Session? session,
+ Session session,
bool isLoading,
String? errorMessage});
}
/// @nodoc
-class __$$_AuthStateCopyWithImpl<$Res>
- extends _$AuthStateCopyWithImpl<$Res, _$_AuthState>
- implements _$$_AuthStateCopyWith<$Res> {
- __$$_AuthStateCopyWithImpl(
- _$_AuthState _value, $Res Function(_$_AuthState) _then)
+class __$$AuthAuthenticatedImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$AuthAuthenticatedImpl>
+ implements _$$AuthAuthenticatedImplCopyWith<$Res> {
+ __$$AuthAuthenticatedImplCopyWithImpl(_$AuthAuthenticatedImpl _value,
+ $Res Function(_$AuthAuthenticatedImpl) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@override
$Res call({
Object? status = null,
- Object? session = freezed,
+ Object? session = null,
Object? isLoading = null,
Object? errorMessage = freezed,
}) {
- return _then(_$_AuthState(
+ return _then(_$AuthAuthenticatedImpl(
status: null == status
? _value.status
: status // ignore: cast_nullable_to_non_nullable
as AuthStatus,
- session: freezed == session
+ session: null == session
? _value.session
: session // ignore: cast_nullable_to_non_nullable
- as Session?,
+ as Session,
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
@@ -133,17 +627,18 @@ class __$$_AuthStateCopyWithImpl<$Res>
/// @nodoc
-class _$_AuthState implements _AuthState {
- const _$_AuthState(
- {required this.status,
- this.session,
+class _$AuthAuthenticatedImpl implements AuthAuthenticated {
+ const _$AuthAuthenticatedImpl(
+ {this.status = AuthStatus.authenticated,
+ required this.session,
this.isLoading = false,
this.errorMessage});
@override
+ @JsonKey()
final AuthStatus status;
@override
- final Session? session;
+ final Session session;
@override
@JsonKey()
final bool isLoading;
@@ -152,14 +647,14 @@ class _$_AuthState implements _AuthState {
@override
String toString() {
- return 'AuthState(status: $status, session: $session, isLoading: $isLoading, errorMessage: $errorMessage)';
+ return 'AuthState.authenticated(status: $status, session: $session, isLoading: $isLoading, errorMessage: $errorMessage)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
- other is _$_AuthState &&
+ other is _$AuthAuthenticatedImpl &&
(identical(other.status, status) || other.status == status) &&
(identical(other.session, session) || other.session == session) &&
(identical(other.isLoading, isLoading) ||
@@ -175,27 +670,568 @@ class _$_AuthState implements _AuthState {
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
- _$$_AuthStateCopyWith<_$_AuthState> get copyWith =>
- __$$_AuthStateCopyWithImpl<_$_AuthState>(this, _$identity);
+ _$$AuthAuthenticatedImplCopyWith<_$AuthAuthenticatedImpl> get copyWith =>
+ __$$AuthAuthenticatedImplCopyWithImpl<_$AuthAuthenticatedImpl>(
+ this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ uninitialized,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ unauthenticated,
+ required TResult Function(AuthStatus status, Session session,
+ bool isLoading, String? errorMessage)
+ authenticated,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ aal2Requested,
+ required TResult Function(
+ AuthStatus status, String url, bool isLoading, String? errorMessage)
+ locationChangeRequired,
+ }) {
+ return authenticated(status, session, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult? Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult? Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ }) {
+ return authenticated?.call(status, session, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (authenticated != null) {
+ return authenticated(status, session, isLoading, errorMessage);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthUninitialized value) uninitialized,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(Aal2Requested value) aal2Requested,
+ required TResult Function(LocationChangeRequired value)
+ locationChangeRequired,
+ }) {
+ return authenticated(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthUninitialized value)? uninitialized,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(Aal2Requested value)? aal2Requested,
+ TResult? Function(LocationChangeRequired value)? locationChangeRequired,
+ }) {
+ return authenticated?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthUninitialized value)? uninitialized,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(Aal2Requested value)? aal2Requested,
+ TResult Function(LocationChangeRequired value)? locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (authenticated != null) {
+ return authenticated(this);
+ }
+ return orElse();
+ }
}
-abstract class _AuthState implements AuthState {
- const factory _AuthState(
- {required final AuthStatus status,
- final Session? session,
+abstract class AuthAuthenticated implements AuthState {
+ const factory AuthAuthenticated(
+ {final AuthStatus status,
+ required final Session session,
final bool isLoading,
- final String? errorMessage}) = _$_AuthState;
+ final String? errorMessage}) = _$AuthAuthenticatedImpl;
@override
AuthStatus get status;
+ Session get session;
+ @override
+ bool get isLoading;
+ @override
+ String? get errorMessage;
+ @override
+ @JsonKey(ignore: true)
+ _$$AuthAuthenticatedImplCopyWith<_$AuthAuthenticatedImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$Aal2RequestedImplCopyWith<$Res>
+ implements $AuthStateCopyWith<$Res> {
+ factory _$$Aal2RequestedImplCopyWith(
+ _$Aal2RequestedImpl value, $Res Function(_$Aal2RequestedImpl) then) =
+ __$$Aal2RequestedImplCopyWithImpl<$Res>;
@override
- Session? get session;
+ @useResult
+ $Res call({AuthStatus status, bool isLoading, String? errorMessage});
+}
+
+/// @nodoc
+class __$$Aal2RequestedImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$Aal2RequestedImpl>
+ implements _$$Aal2RequestedImplCopyWith<$Res> {
+ __$$Aal2RequestedImplCopyWithImpl(
+ _$Aal2RequestedImpl _value, $Res Function(_$Aal2RequestedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? status = null,
+ Object? isLoading = null,
+ Object? errorMessage = freezed,
+ }) {
+ return _then(_$Aal2RequestedImpl(
+ status: null == status
+ ? _value.status
+ : status // ignore: cast_nullable_to_non_nullable
+ as AuthStatus,
+ isLoading: null == isLoading
+ ? _value.isLoading
+ : isLoading // ignore: cast_nullable_to_non_nullable
+ as bool,
+ errorMessage: freezed == errorMessage
+ ? _value.errorMessage
+ : errorMessage // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$Aal2RequestedImpl implements Aal2Requested {
+ const _$Aal2RequestedImpl(
+ {this.status = AuthStatus.aal2Requested,
+ this.isLoading = false,
+ this.errorMessage});
+
+ @override
+ @JsonKey()
+ final AuthStatus status;
+ @override
+ @JsonKey()
+ final bool isLoading;
+ @override
+ final String? errorMessage;
+
+ @override
+ String toString() {
+ return 'AuthState.aal2Requested(status: $status, isLoading: $isLoading, errorMessage: $errorMessage)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$Aal2RequestedImpl &&
+ (identical(other.status, status) || other.status == status) &&
+ (identical(other.isLoading, isLoading) ||
+ other.isLoading == isLoading) &&
+ (identical(other.errorMessage, errorMessage) ||
+ other.errorMessage == errorMessage));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, status, isLoading, errorMessage);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$Aal2RequestedImplCopyWith<_$Aal2RequestedImpl> get copyWith =>
+ __$$Aal2RequestedImplCopyWithImpl<_$Aal2RequestedImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ uninitialized,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ unauthenticated,
+ required TResult Function(AuthStatus status, Session session,
+ bool isLoading, String? errorMessage)
+ authenticated,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ aal2Requested,
+ required TResult Function(
+ AuthStatus status, String url, bool isLoading, String? errorMessage)
+ locationChangeRequired,
+ }) {
+ return aal2Requested(status, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult? Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult? Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ }) {
+ return aal2Requested?.call(status, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (aal2Requested != null) {
+ return aal2Requested(status, isLoading, errorMessage);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthUninitialized value) uninitialized,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(Aal2Requested value) aal2Requested,
+ required TResult Function(LocationChangeRequired value)
+ locationChangeRequired,
+ }) {
+ return aal2Requested(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthUninitialized value)? uninitialized,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(Aal2Requested value)? aal2Requested,
+ TResult? Function(LocationChangeRequired value)? locationChangeRequired,
+ }) {
+ return aal2Requested?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthUninitialized value)? uninitialized,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(Aal2Requested value)? aal2Requested,
+ TResult Function(LocationChangeRequired value)? locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (aal2Requested != null) {
+ return aal2Requested(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class Aal2Requested implements AuthState {
+ const factory Aal2Requested(
+ {final AuthStatus status,
+ final bool isLoading,
+ final String? errorMessage}) = _$Aal2RequestedImpl;
+
+ @override
+ AuthStatus get status;
@override
bool get isLoading;
@override
String? get errorMessage;
@override
@JsonKey(ignore: true)
- _$$_AuthStateCopyWith<_$_AuthState> get copyWith =>
+ _$$Aal2RequestedImplCopyWith<_$Aal2RequestedImpl> get copyWith =>
throw _privateConstructorUsedError;
}
+
+/// @nodoc
+abstract class _$$LocationChangeRequiredImplCopyWith<$Res>
+ implements $AuthStateCopyWith<$Res> {
+ factory _$$LocationChangeRequiredImplCopyWith(
+ _$LocationChangeRequiredImpl value,
+ $Res Function(_$LocationChangeRequiredImpl) then) =
+ __$$LocationChangeRequiredImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call(
+ {AuthStatus status, String url, bool isLoading, String? errorMessage});
+}
+
+/// @nodoc
+class __$$LocationChangeRequiredImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$LocationChangeRequiredImpl>
+ implements _$$LocationChangeRequiredImplCopyWith<$Res> {
+ __$$LocationChangeRequiredImplCopyWithImpl(
+ _$LocationChangeRequiredImpl _value,
+ $Res Function(_$LocationChangeRequiredImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? status = null,
+ Object? url = null,
+ Object? isLoading = null,
+ Object? errorMessage = freezed,
+ }) {
+ return _then(_$LocationChangeRequiredImpl(
+ status: null == status
+ ? _value.status
+ : status // ignore: cast_nullable_to_non_nullable
+ as AuthStatus,
+ url: null == url
+ ? _value.url
+ : url // ignore: cast_nullable_to_non_nullable
+ as String,
+ isLoading: null == isLoading
+ ? _value.isLoading
+ : isLoading // ignore: cast_nullable_to_non_nullable
+ as bool,
+ errorMessage: freezed == errorMessage
+ ? _value.errorMessage
+ : errorMessage // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$LocationChangeRequiredImpl implements LocationChangeRequired {
+ const _$LocationChangeRequiredImpl(
+ {this.status = AuthStatus.locationChangeRequired,
+ required this.url,
+ this.isLoading = false,
+ this.errorMessage});
+
+ @override
+ @JsonKey()
+ final AuthStatus status;
+ @override
+ final String url;
+ @override
+ @JsonKey()
+ final bool isLoading;
+ @override
+ final String? errorMessage;
+
+ @override
+ String toString() {
+ return 'AuthState.locationChangeRequired(status: $status, url: $url, isLoading: $isLoading, errorMessage: $errorMessage)';
+ }
+
+ @override
+ bool operator ==(dynamic other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$LocationChangeRequiredImpl &&
+ (identical(other.status, status) || other.status == status) &&
+ (identical(other.url, url) || other.url == url) &&
+ (identical(other.isLoading, isLoading) ||
+ other.isLoading == isLoading) &&
+ (identical(other.errorMessage, errorMessage) ||
+ other.errorMessage == errorMessage));
+ }
+
+ @override
+ int get hashCode =>
+ Object.hash(runtimeType, status, url, isLoading, errorMessage);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$LocationChangeRequiredImplCopyWith<_$LocationChangeRequiredImpl>
+ get copyWith => __$$LocationChangeRequiredImplCopyWithImpl<
+ _$LocationChangeRequiredImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ uninitialized,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ unauthenticated,
+ required TResult Function(AuthStatus status, Session session,
+ bool isLoading, String? errorMessage)
+ authenticated,
+ required TResult Function(
+ AuthStatus status, bool isLoading, String? errorMessage)
+ aal2Requested,
+ required TResult Function(
+ AuthStatus status, String url, bool isLoading, String? errorMessage)
+ locationChangeRequired,
+ }) {
+ return locationChangeRequired(status, url, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult? Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult? Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult? Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ }) {
+ return locationChangeRequired?.call(status, url, isLoading, errorMessage);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ uninitialized,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ unauthenticated,
+ TResult Function(AuthStatus status, Session session, bool isLoading,
+ String? errorMessage)?
+ authenticated,
+ TResult Function(AuthStatus status, bool isLoading, String? errorMessage)?
+ aal2Requested,
+ TResult Function(AuthStatus status, String url, bool isLoading,
+ String? errorMessage)?
+ locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (locationChangeRequired != null) {
+ return locationChangeRequired(status, url, isLoading, errorMessage);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthUninitialized value) uninitialized,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(Aal2Requested value) aal2Requested,
+ required TResult Function(LocationChangeRequired value)
+ locationChangeRequired,
+ }) {
+ return locationChangeRequired(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthUninitialized value)? uninitialized,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(Aal2Requested value)? aal2Requested,
+ TResult? Function(LocationChangeRequired value)? locationChangeRequired,
+ }) {
+ return locationChangeRequired?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthUninitialized value)? uninitialized,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(Aal2Requested value)? aal2Requested,
+ TResult Function(LocationChangeRequired value)? locationChangeRequired,
+ required TResult orElse(),
+ }) {
+ if (locationChangeRequired != null) {
+ return locationChangeRequired(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class LocationChangeRequired implements AuthState {
+ const factory LocationChangeRequired(
+ {final AuthStatus status,
+ required final String url,
+ final bool isLoading,
+ final String? errorMessage}) = _$LocationChangeRequiredImpl;
+
+ @override
+ AuthStatus get status;
+ String get url;
+ @override
+ bool get isLoading;
+ @override
+ String? get errorMessage;
+ @override
+ @JsonKey(ignore: true)
+ _$$LocationChangeRequiredImplCopyWith<_$LocationChangeRequiredImpl>
+ get copyWith => throw _privateConstructorUsedError;
+}
diff --git a/flutter-ory-network/lib/blocs/auth/auth_event.dart b/flutter-ory-network/lib/blocs/auth/auth_event.dart
index 041a607..199c044 100644
--- a/flutter-ory-network/lib/blocs/auth/auth_event.dart
+++ b/flutter-ory-network/lib/blocs/auth/auth_event.dart
@@ -19,4 +19,20 @@ final class ChangeAuthStatus extends AuthEvent {
final class GetCurrentSessionInformation extends AuthEvent {}
+final class RequireLocationChange extends AuthEvent {
+ final String url;
+
+ RequireLocationChange({required this.url});
+ @override
+ List