Skip to main content

ThunderIDSignedOut

ThunderIDSignedOut is a guard widget that renders its child only when the user is not authenticated. When the user is signed in it renders fallback instead (or nothing, if no fallback is provided).

This widget re-renders automatically whenever the auth state in the parent ThunderIDProvider changes.

Usage

import 'package:thunderid_flutter/thunderid_flutter.dart';

ThunderIDSignedOut(
child: const AuthScreen(),
fallback: const HomeScreen(),
)

Using ThunderIDSignedOut and ThunderIDSignedIn together in a root router:

Widget build(BuildContext context) {
final thunder = ThunderIDProvider.of(context);

if (!thunder.initialized) {
return const Scaffold(
body: Center(child: CircularProgressIndicator()),
);
}

return Scaffold(
body: Stack(
children: [
ThunderIDSignedIn(child: const HomeScreen()),
ThunderIDSignedOut(child: const AuthScreen()),
],
),
);
}

Parameters

ParameterTypeRequiredDescription
childWidgetRendered when ThunderIDProvider.of(context).isSignedIn is false.
fallbackWidget?Rendered when the user is signed in. Defaults to const SizedBox.shrink() if omitted.

Explore with AI

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.