Conversation
Expose native min/max write sentinels on iOS, Android, and web. Windows is unsupported until the C++ SDK adds the API.
Using Gemini Code AssistThe 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
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 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. |
Description
Adds
FieldValue.minimumandFieldValue.maximumwrite sentinels soset()/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/Maximumyet. 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_apiin the 2026-09-11 Firebase SDK watcher report after iOS 12.19.0 added the native APIs.Checklist
///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
Test plan
cloud_firestore/test/field_value_test.dartcloud_firestore_web/test/field_value_factory_web_test.dartexample/integration_test/field_value_e2e.darton iOS, Android, and web: min/max vs existing value, missing field, non-numeric field