Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picker运行时报错 #401

Closed
p-mega opened this issue Jan 15, 2023 · 5 comments
Closed

picker运行时报错 #401

p-mega opened this issue Jan 15, 2023 · 5 comments

Comments

@p-mega
Copy link

p-mega commented Jan 15, 2023

调用picker弹窗时报错如下:
The following NoSuchMethodError was thrown building BrnBottomPickerWidget(dirty, dependencies: [_LocalizationsScope-[GlobalKey#bf2cb]], state: BrnBottomPickerWidgetState#29ea4(tickers: tracking 1 ticker)):
The getter 'localizedResource' was called on null.
Receiver: null
Tried calling: localizedResource

  • 运行设备
  • RedMi K30 Pro
  • bruno: ^3.2.0
@p-mega
Copy link
Author

p-mega commented Jan 15, 2023

已解决,官网中给出的示例代码缺少了confirm和cancel这两个参数

@p-mega
Copy link
Author

p-mega commented Jan 15, 2023

showDatePicker显示日期的时候月份显示不出来

@violinday
Copy link
Collaborator

showDatePicker显示日期的时候月份显示不出来

感谢反馈~
麻烦提供下关键代码、错误日志或截图,方便我们查找问题

@p-mega
Copy link
Author

p-mega commented Jan 17, 2023 via email

@leftcoding
Copy link
Collaborator

添加国际化依赖,代码如下:

dependencies:
  flutter:
    sdk: flutter
  bruno: ^3.2.0
  flutter_localizations: # 新增这行
    sdk: flutter

在 Main App 添加如下代码:

return MaterialApp(
      // 新增
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        BrnLocalizationDelegate.delegate,
      ],
     // 新增
      supportedLocales: const [
        Locale('en', 'US'),
        Locale('zh', 'CN'),
      ],
      home: ...
    );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants