Skip to content

Conversation

@Adair-GA
Copy link

DateFormat constructors now require the locale argument to be a nullable string. Before, if the argument was not a String?, an exception would be thrown (see #14)


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @Adair-GA, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the DateFormat constructors within the intl package by explicitly typing the locale argument as a nullable string (String?). This change addresses a previous behavior where passing a non-String? argument would result in an exception, thereby enhancing the robustness and predictability of the API by aligning it with expected null-safe practices.

Highlights

  • Type Safety & API Consistency: All DateFormat constructors have been updated to explicitly type the locale parameter as String?, ensuring that the argument can be a nullable string without throwing an exception.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly updates the named constructors of DateFormat to explicitly type the optional locale parameter as String?. This is a valuable improvement for type safety and aligns with modern Dart practices, especially with null safety. The changes are consistent and well-executed across all relevant constructors. I have no further suggestions, great work!

@github-actions
Copy link

Package publishing

Package Version Status Publish tag (post-merge)
package:intl 0.20.3-wip WIP (no publish necessary)
package:intl4x 0.13.0 ready to publish intl4x-v0.13.0
package:intl_translation 0.20.1 already published at pub.dev
package:messages_shrinker 0.2.2-wip WIP (no publish necessary)

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@github-actions
Copy link

github-actions bot commented Aug 25, 2025

PR Health

Breaking changes ⚠️
Package Change Current Version New Version Needed Version Looking good?
intl Breaking 0.20.2 0.20.3-wip 0.21.0
Got "0.20.3-wip" expected >= "0.21.0" (breaking changes)
⚠️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

Coverage ✔️
File Coverage
pkgs/intl/lib/src/intl/date_format.dart 💚 66 %

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

API leaks ⚠️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources
intl StringStack intl/date_format.dart::_DateFormatField::parse::input
intl/date_format.dart::_DateFormatField::parseLoose::input
intl/date_format.dart::_DateFormatField::parseLiteral::input
intl/date_format.dart::_DateFormatField::parseLiteralLoose::input
intl/date_format.dart::_DateFormatField::throwFormatException::stack
intl/number_parser_base.dart::NumberParserBase::input
intl/number_parser_base.dart::NumberParserBase::parseNumber::input
intl DateBuilder intl/date_format.dart::_DateFormatField::parse::dateFields
intl/date_format.dart::_DateFormatField::parseLoose::dateFields

This check can be disabled by tagging the PR with skip-leaking-check.

License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

This check can be disabled by tagging the PR with skip-license-check.

@mosuem
Copy link
Member

mosuem commented Aug 25, 2025

You can ignore the API leaks, that can be fixed in a different PR and not caused by this. For the version, I don't believe this is breaking as the underlying constructor redirection does take a String? - so those would have thrown before as well.

So a changelog entry and you are good to go!

@Adair-GA
Copy link
Author

Is it good like that or do I need to change anything?

@mosuem
Copy link
Member

mosuem commented Sep 1, 2025

All good - I will start merging, which is a bit of a complicated process for this package, as the source-of-truth is inside Google. So please be patient :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants