MasamuneAdapterScope<TAdapter extends MasamuneAdapter> constructor
const
MasamuneAdapterScope<TAdapter extends MasamuneAdapter> ({})
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を設定します。
adapterにMasamuneAdapterを渡してください。
また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,
});