AuthAdapterScope constructor
const
AuthAdapterScope({
- Key? key,
- required Widget child,
- required AuthAdapter adapter,
Place it on top of MaterialApp, etc., and set AuthAdapter for the entire app.
Pass AuthAdapter to adapter.
Also, by using AuthAdapterScope.of in a descendant widget, you can retrieve the AuthAdapter set in the AuthAdapterScope.
MaterialAppなどの上に配置して、アプリ全体にAuthAdapterを設定します。
adapterにAuthAdapterを渡してください。
またAuthAdapterScope.ofを子孫のウィジェット内で利用することによりAuthAdapterScopeで設定されたAuthAdapterを取得することができます。
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return AuthAdapterScope(
adapter: const RuntimeAuthAdapter(),
child: MaterialApp(
home: const AuthPage(),
),
);
}
}
Implementation
const AuthAdapterScope({
super.key,
required this.child,
required this.adapter,
});