builder property
The builder of the subject to be rebuilt.
Return MaterialApp, etc. as shown in the example below. Also, from localize in builder, pass appropriate values for MaterialApp.locale, MaterialApp.localizationsDelegates, MaterialApp.supportedLocales, and MaterialApp. localeResolutionCallback
, respectively.
リビルドを行う対象のビルダー。
下記例のようにMaterialAppなどを返してください。また、builderのlocalizeからMaterialApp.locale、MaterialApp.localizationsDelegates、MaterialApp.supportedLocales、MaterialApp.localeResolutionCallbackに対してそれぞれ適切な値を渡してください。
LocalizeScope(
localize: AppLocalize(),
builder: (context, localize) {
return MaterialApp(
locale: localize.locale,
localizationsDelegates: localize.delegates(),
supportedLocales: localize.supportedLocales(),
localeResolutionCallback: localize.localeResolutionCallback(),
);
}
);
Implementation
final Widget Function(BuildContext context, AppLocalizeBase localize) builder;