pluginWidget method

  1. @override
Widget pluginWidget(
  1. BuildContext context
)
inherited

插件界面

Implementation

@override
Widget pluginWidget(BuildContext context) {
  return Theme(
    data: ThemeData(
      brightness: MediaQuery.platformBrightnessOf(context),
    ),
    child: Directionality(
      textDirection: TextDirection.ltr,
      child: Localizations(
        locale: const Locale('zh', 'CN'),
        delegates: const [
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
          GlobalCupertinoLocalizations.delegate,
        ],
        child: Navigator(
          onGenerateInitialRoutes: (navigator, name) => [
            MaterialPageRoute(
              builder: (context) => build(context),
            )
          ],
        ),
      ),
    ),
  );
}