MasamuneAdapterScope<TAdapter extends MasamuneAdapter> constructor

const MasamuneAdapterScope<TAdapter extends MasamuneAdapter>({
  1. Key? key,
  2. required Widget child,
  3. required TAdapter adapter,
})

MasamuneAdapter for the entire app by placing it on top of MaterialApp, etc.

Pass MasamuneAdapter to adapter.

Also, by using MasamuneAdapterScope.of in a descendant widget, you can retrieve the MasamuneAdapter set in the MasamuneAdapterScope.

MaterialAppなどの上に配置して、アプリ全体にMasamuneAdapterを設定します。

adapterMasamuneAdapterを渡してください。

またMasamuneAdapterScope.ofを子孫のウィジェット内で利用することによりMasamuneAdapterScopeで設定されたMasamuneAdapterを取得することができます。

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MasamuneAdapterScope(
      adapter: const FileMasamuneAdapter(),
      child: MaterialApp(
        home: const PickerPage(),
      ),
    );
  }
}

Implementation

const MasamuneAdapterScope({
  super.key,
  required this.child,
  required this.adapter,
});