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

Date picker i18n #12324

Merged
merged 5 commits into from
Oct 6, 2017
Merged

Date picker i18n #12324

merged 5 commits into from
Oct 6, 2017

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Sep 29, 2017

Fixes #12185. This version pull in all localizations provided by package:intl. I'm working on a separate PR that reduces package:intl to only the list of locales supported by Flutter.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Monday-based?

Copy link
Contributor Author

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,
);
}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@Hixie
Copy link
Contributor

Hixie commented Sep 29, 2017

Can we fix #12050 first? Or at least next? I would rather we didn't keep adding dependencies on intl.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as intl

Copy link
Contributor Author

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.

@Hixie
Copy link
Contributor

Hixie commented Sep 29, 2017

LGTM

@Hixie
Copy link
Contributor

Hixie commented Oct 10, 2017

This had a bigger-than-usual negative impact on the aot_snapshot_size benchmarks.

@yjbanov
Copy link
Contributor Author

yjbanov commented Oct 10, 2017

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 complex_layout:

aot_snapshot_size_isolate:

Before this PR: 1832972 bytes
After this PR: 1941640 bytes
After #12466: 1867322 bytes

aot_snapshot_size_rodata:

Before this PR: 1758568 bytes
After this PR: 1892776 bytes
After #12466: 1794616 bytes

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Localize showDatePicker
3 participants