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

无法显示月份 #547

Open
564077048 opened this issue Nov 25, 2024 · 9 comments
Open

无法显示月份 #547

564077048 opened this issue Nov 25, 2024 · 9 comments

Comments

@564077048
Copy link

微信图片_20241125150333
BrnDatePicker.showDatePicker(context,
maxDateTime: DateTime.parse('2028-01-01 18:26'),
minDateTime: DateTime.parse('2020-01-01 18:26'),
initialDateTime: DateTime.parse('2024-11-25 18:26'),
// 支持DateTimePickerMode.date、DateTimePickerMode.datetime、DateTimePickerMode.time
pickerMode: BrnDateTimePickerMode.datetime,
minuteDivider: 1,
//pickerTitleConfig: BrnPickerTitleConfig.Default,
dateFormat: 'yyyy-MM-dd HH:mm',
onConfirm: (dateTime, list) {
BrnToast.show("onConfirm: $dateTime $list", context);
},
onClose: () {
print("onClose");
},
onCancel: () {
print("onCancel");
},
onChange: (dateTime, list) {
print("onChange: $dateTime $list");
});

@yecaiyu1999
Copy link

localizationsDelegates: [
......
BrnLocalizationDelegate.delegate,
]
你把这个配上试试

@564077048
Copy link
Author

这个怎么加啊

@564077048
Copy link
Author

image

@yecaiyu1999
Copy link

这个怎么加啊
#401 看看这里面,最后有解决方案

@564077048
Copy link
Author

564077048 commented Jan 3, 2025 via email

@564077048
Copy link
Author

564077048 commented Jan 3, 2025 via email

@yecaiyu1999
Copy link

localizationsDelegates: AppLocalizations.localizationsDelegates,一定要用这一行得

------------------ 原始邮件 ------------------ 发件人: "LianjiaTech/bruno" @.>; 发送时间: 2024年12月31日(星期二) 上午8:11 @.>; @.@.>; 主题: Re: [LianjiaTech/bruno] 无法显示月份 (Issue #547) 这个怎么加啊 #401 看看这里面,最后有解决方案 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
找到AppLocalizations.localizationsDelegates定义的地方加,或者如下加,大概意思就是这么个意思

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

@564077048
Copy link
Author

564077048 commented Jan 3, 2025 via email

@yecaiyu1999
Copy link

我其他页面会报错 还是算了

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2025年1月3日(星期五) 下午3:50 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [LianjiaTech/bruno] 无法显示月份 (Issue #547) localizationsDelegates: AppLocalizations.localizationsDelegates,一定要用这一行得 … ------------------ 原始邮件 ------------------ 发件人: "LianjiaTech/bruno" @.>; 发送时间: 2024年12月31日(星期二) 上午8:11 @.>; @.@.>; 主题: Re: [LianjiaTech/bruno] 无法显示月份 (Issue #547) 这个怎么加啊 #401 看看这里面,最后有解决方案 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.> 找到AppLocalizations.localizationsDelegates定义的地方加,或者如下加,大概意思就是这么个意思 return MaterialApp( localizationsDelegates: [ ...AppLocalizations.localizationsDelegates, // 新增 GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, GlobalWidgetsLocalizations.delegate, BrnLocalizationDelegate.delegate, ], // 新增 supportedLocales: const [ Locale('en', 'US'), Locale('zh', 'CN'), ], .... ); — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>
复制他这个代码自己去封装一份呗,这个太久没更新了。老版本估计还好一点,新的就说不准,腾讯也有组件库https://tdesign.tencent.com/flutter/getting-started,但是有能力还是自己封装一套好一点。

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

2 participants