-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Date picker i18n #12324
Date picker i18n #12324
Conversation
final int weekDayFromMonday = new DateTime(year, month).weekday - 1; | ||
// 0-based day of week, with 0 representing Sunday. | ||
final int firstDayOfWeekFromSunday = localizations.firstDayOfWeekIndex; | ||
// firstDayOfWeekFromSunday recomputed to be Sunday-based |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Monday-based?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL. See how confusing this is? 😄 Done. Good catch!
textDirection: textDirection, | ||
child: child, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you provide both, the way you have this built the locale will override the directionality. Presumably if both are given, the directionality should be on the inside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, also actually used the child
in the dialog! Also added tests.
Can we fix #12050 first? Or at least next? I would rather we didn't keep adding dependencies on edit: Never mind, I see that this is in fact laying the groundwork for doing that. That's great. Thanks! |
@@ -4,7 +4,9 @@ | |||
|
|||
import 'package:flutter/material.dart'; | |||
import 'package:flutter_test/flutter_test.dart'; | |||
import 'package:intl/intl.dart'; | |||
import 'package:intl/intl.dart' hide TextDirection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as intl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, removed this import altogether. It was used only in one place, which can use MaterialLocalizations
for this purpose.
51dd4c1
to
a330432
Compare
This had a bigger-than-usual negative impact on the aot_snapshot_size benchmarks. |
This is partly because we added localized dates, and partly because we added localized dates for all locales in the world. #12466 partially addresses the issue. Here are the numbers for building
Before this PR: 1832972 bytes
Before this PR: 1758568 bytes |
Fixes #12185. This version pull in all localizations provided by
package:intl
. I'm working on a separate PR that reducespackage:intl
to only the list of locales supported by Flutter.