4.0.1: README rewrite, rendered screenshots, AI assistant guide, and five fixes - #74
Merged
Merged
Conversation
…dering docs
Rendering the real widgets for the new README screenshots, and then checking
the claims the AI-assistant guide makes, surfaced five defects.
1. showMapLocationPicker threw on the 3.x migration path. The route was
MaterialPageRoute<PickedPlace>, and a config carried over from 3.x as
`onNext: (r) => Navigator.pop(context, r)` pops it with a GeocodingResult:
A request was made to pop a route with a result of type
GeocodingResult, but the route expected a value of type PickedPlace.
An assertion in debug, a TypeError in release. The route is now typed
Object?, the PickedPlace is captured the moment the user confirms (before
the caller's onNext runs and before the route's controller is disposed),
and whatever is popped is translated back to that pick. Backing out still
resolves to null.
2. A geocoder given to the controller was silently discarded. The widget
called `ctrl.updateConfig(config, geoCodingConfig: null)` whenever it had
no geocoder of its own, overwriting the one passed to
`MapLocationPickerController(geoCodingConfig: ...)`. A widget-supplied
geocoder still wins; otherwise the controller keeps its own.
These two masked each other. The double-pop test added in bba4866 only
ever popped with a null result, because (2) was swapping the test's fake
geocoder for a real one that failed -- so (1) was never exercised.
test/show_picker_result_test.dart covers both; four of its six tests fail
against the previous code.
3. The back button and the search field were two separate Positioned widgets
of different heights and insets, so they sat off-centre from each other.
They now share one Row.
4. bottomCardTitle had no horizontal inset while the ListTile below it has
16 px, so the two started at different left edges.
5. The default search hint "Search for place, address, landmark, etc." was
clipped mid-sentence ("landmark,") whenever the back button took its
space -- on real 393 pt phones as well as in screenshots. Now "Search for
a place or address". Apps that set strings.searchHint are unaffected.
89 tests, green on Flutter 3.38.1 and 3.47.2.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…t guide README - Step-by-step getting started (requirements, API key, per-platform setup in collapsible sections, first pick), a section per feature, a configuration reference, API key security and costs, and troubleshooting. - Fixes two errors in the old README: the iOS AppDelegate snippet did not match current Flutter templates, and Android was listed as API 21 when google_maps_flutter_android needs 24. - Documents that an embedded map inside a scroll view needs an EagerGestureRecognizer to receive drags, and that map tiles need a mapStyle or cloudMapId to go dark. Screenshots - tool/screenshots renders eight scenes from the real widgets with canned Places and Geocoding responses, so search, details and nearby search run through the package's own code; frame.py adds device frames. Google tiles cannot load in a test, so the map is an illustration, and the README says so. - One WebP set serves both the README gallery and the pub.dev gallery (now eight images). The old PNGs are removed; the archive drops from ~10 MB to 915 KB, with doc/readme and tool excluded by .pubignore. AI assistants - llms.txt: an authoritative 4.x API reference for language models. - README section with project rules for CLAUDE.md, AGENTS.md, Copilot, Cursor and Gemini, and seven copy-paste prompts: integrate, delivery step, embed, migrate, localize, debug empty search, and tests. - Each prompt was evaluated twice by a blind assistant with no package source, then compiled and audited. Round one found a blocker (searchConfig moved inside the config on migration), legacy "Places API" advice, mistranslated nearbyPlaces* strings, and a missed empty --dart-define key. After fixing both the prompts and llms.txt, all seven analyze clean with no invented APIs. Also: package description rewritten, CONTRIBUTING explains how to regenerate screenshots and keep llms.txt accurate, readme_samples.dart compiles every Dart sample in the new README. pana 160/160 locally. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Before publishing, every factual claim in the README, llms.txt, CHANGELOG and migration guide was checked against lib/, both Flutter app templates, the plugin sources and live Google endpoints. A skeptic then tried to refute each finding: 22 survived the first pass and 10 more survived a second pass over the corrections themselves. Setup - iOS: apps created with Flutter 3.38 target iOS 13, but the Google Maps plugin needs 14, so pod install failed. The deployment target is now documented. - iOS: the AppDelegate snippet looked like a complete file and matched neither template. Pasting it removed plugin registration; it now shows only the two additions. - Web: the Maps script was async/loading=async. google_maps_flutter_web constructs google.maps.Map directly and documents a synchronous tag. Fixed in the README, llms.txt, the prompts and example/web/index.html. Behaviour - Error kinds are documented per API: Places (New) maps HTTP status (a wrong key is invalidRequest), the Geocoding API maps its body status (a wrong key is requestDenied, with no statusCode), and an empty key fails search with unknown in debug builds. - A missing native key crashes the app rather than blanking the map; mapUnavailable is effectively web-only and only raised on a camera move. - startWithCurrentLocation uses the last known position on timeout and never calls onError. confirm() skips the button's guards. onMainMarkerPositionChanged isn't called for initialPosition. fabTooltip isn't part of strings. cardType only affects the search field. - Confirm "does nothing" means there is no onNext; a custom confirmButton ignores requireGeocodedAddress. Security - The headers sample used dart:io Platform, which throws on web; it now uses kIsWeb/defaultTargetPlatform. - The Geocoding API rejects referrer-restricted keys, and an injected GeoCodingConfig doesn't inherit language. Migration - The README and the migration prompt described 1.x/2.x renames as 3.x -> 4.x changes. Both now follow MIGRATION_GUIDE.md: the Flutter bump, trimmed re-exports, four deprecations, and behaviour changes to check. - The migration guide said "Both" deprecations are removed in 5.0.0; it is all four. Prompts - Re-evaluated blind after the fixes (round 3): all seven analyze with zero errors and no invented APIs, scoring 9, 9, 8, 9, 10, 9 and 10. The follow-up refinements (testWidgets/dispose, iOS target, the 18th string, per-API error kinds) were verified by a separate audit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A rewrite of the README to make it clearer, with better screenshots and a guide for AI coding assistants. Rendering the screenshots through the real widgets also turned up five package defects, which are fixed here as 4.0.1.
Preview the README: https://github.com/itsarvinddev/map_location_picker/blob/docs/readme-visuals-and-llm-guide/README.md
README
AppDelegatesnippet didn't match current Flutter templates.google_maps_flutter_androidneeds 24.EagerGestureRecognizer, or it won't receive drags.mapStyleorcloudMapId, because Google's tiles don't switch automatically.Screenshots
tool/screenshotsrenders eight scenes from the real widgets. Canned Places and Geocoding responses mean autocomplete, place details and nearby search all run through the package's own code.frame.pyadds device frames and builds the hero image.AI coding assistants
llms.txt: an authoritative 4.x API reference for language models.CLAUDE.md,AGENTS.md,.github/copilot-instructions.md,.cursor/rules/*.mdcorGEMINI.md.How the prompts were tested
Each prompt went to a fresh assistant that could not see the package source or run the analyzer. It worked in a small Flutter project built for that scenario. A second agent then ran
flutter analyze(plusgen-l10nandflutter testwhere relevant), checked every identifier againstlib/, and traced each failure back to the prompt text.In round 2, all seven analyze clean and use no invented APIs. Round 1 found:
searchConfigwas moved insideMapLocationPickerConfig, which doesn't compile.nearbyPlaces*strings were translated as "nearby places", but they label matching addresses.String.fromEnvironmentkey without--dart-defineis empty.testWidgets, which fails on the controller's pending timer.Both the prompts and
llms.txtwere fixed to cover each of these. A few smaller round-2 suggestions (location permissions and the web script tag in the delivery reply, and the scroll-view gesture note) were applied without a third run.Package fixes (4.0.1)
showMapLocationPickerthrew when a 3.x-styleonNextpopped with aGeocodingResult. The route now accepts any popped value and still returns thePickedPlace.MapLocationPickerControllerwas silently replaced when the widget mounted.bottomCardTitleis aligned with the address below it.Each fix has a regression test in
test/show_picker_result_test.dart.Verification
dart format: clean.flutter analyze --fatal-infos, package and example: clean on 3.47.2 and on the 3.38.1 floor, including thepub downgradepass.flutter test: 89 passed on both SDKs. The screenshot harness renders on both.example/lib/readme_samples.dart.flutter pub publish --dry-run: no warnings except uncommitted files at the time.Pre-release audit (commit ca4ec43)
Before merging and publishing, every factual claim in the README,
llms.txt, CHANGELOG and migration guide was checked againstlib/, both Flutter app templates, the plugin sources and live Google endpoints.The most important fixes:
pod installfailed. This is now documented.AppDelegate.swift, and pasting it removed plugin registration. It now shows only the two additions.google_maps_flutter_webdocuments. This applies to the README,llms.txt, the prompts and the example app.dart:ioPlatform, which throws on web. The guidance now also covers the Geocoding API rejecting referrer-restricted keys.invalidRequest. With the Geocoding API it arrives asrequestDenied. An empty key fails search withunknownin debug builds.MIGRATION_GUIDE.md. Previously they presented 1.x/2.x renames as 3.x→4.x changes.The prompts were then re-evaluated blind (round 3). All seven analyze with zero errors and no invented APIs, scoring 9, 9, 8, 9, 10, 9 and 10.
Before merging
^4.0.1, and the prompts link tollms.txtonmaster. Merge and publish 4.0.1 together, otherwise a user who copies the README during the gap gets a version that doesn't exist yet.PointerInterceptor. This is unchanged from 4.0.0.🤖 Generated with Claude Code