Skip to content

feat(firestore): add FieldValue.minimum and FieldValue.maximum - #18697

Open
SelaseKay wants to merge 1 commit into
mainfrom
feat/firestore-fieldvalue-min-max
Open

SelaseKay wants to merge 1 commit into
mainfrom
feat/firestore-fieldvalue-min-max

Conversation

@SelaseKay

Copy link
Copy Markdown
Contributor

Description

Adds FieldValue.minimum and FieldValue.maximum write sentinels so set() / update() can clamp a numeric field to the min or max of its current value and the given operand.

Native iOS, Android, and JS already expose these APIs. This PR wraps them in Dart, the platform interface codec (types 200–203), Apple/Android codecs, and web JS interop.

Windows is not supported: the Firebase C++ SDK does not expose FieldValue::Minimum / Maximum yet. The Windows codec consumes the payload and throws an explicit error. E2E tests for these sentinels are skipped on Windows.

Related Issues

No existing FlutterFire issue. Tracked as a missing_api in the 2026-09-11 Firebase SDK watcher report after iOS 12.19.0 added the native APIs.

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Test plan

  • Unit tests in cloud_firestore/test/field_value_test.dart
  • Web factory tests in cloud_firestore_web/test/field_value_factory_web_test.dart
  • E2E in example/integration_test/field_value_e2e.dart on iOS, Android, and web: min/max vs existing value, missing field, non-numeric field
  • Confirm Windows throws a clear unsupported error (or the e2e skip holds)

Expose native min/max write sentinels on iOS, Android, and web. Windows
is unsupported until the C++ SDK adds the API.
@gemini-code-assist

Copy link
Copy Markdown
Contributor
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the 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 counterproductive. 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.

@SelaseKay
SelaseKay marked this pull request as ready for review September 16, 2026 10:50
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

Successfully merging this pull request may close these issues.

1 participant