AuthAdapterScope constructor

const AuthAdapterScope({
  1. Key? key,
  2. required Widget child,
  3. 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を設定します。

adapterAuthAdapterを渡してください。

また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,
});