使用GETX在Flutter中未发现材料定位

6qqygrtg  于 2021-07-26  发布在  Flutter
关注(0)|答案(1)|浏览(160)

当我在输入选项卡上打开日期选择器对话框时,它是错误的

请帮帮我,我用的是GETX Flutter
这里是main dart

@override
  Widget build(BuildContext context) {
    GetStorage box = GetStorage();
    //print(box.read('lang'));
    return GetMaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      locale: LocalizationService.getLocaleFromLanguage(
          langCode: box.read('lang') ?? 'en'),
      fallbackLocale: LocalizationService.fallbackLocale,
      translations: LocalizationService(),
      initialRoute: AppPages.INITIAL,
      getPages: AppPages.routes,
    );
  }
h7wcgrx3

h7wcgrx31#

你可以加上这个

GetMaterialApp(
      title: "Application",
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],

不要忘记导入pubspec.yaml

相关问题