Skip to main content

ThunderIDSignedIn

ThunderIDSignedIn is a guard widget that renders its child only when the user is authenticated. When the user is not 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';

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

Using ThunderIDSignedIn and ThunderIDSignedOut together:

Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
ThunderIDSignedIn(child: const HomeScreen()),
ThunderIDSignedOut(child: const AuthScreen()),
],
),
);
}

Parameters

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

Product

DocsAPIsSDKs
© WSO2 LLC. All rights reserved.Privacy PolicyCookie Policy