Skip to content

4.0.1: README rewrite, rendered screenshots, AI assistant guide, and five fixes - #74

Merged
itsarvinddev merged 3 commits into
masterfrom
docs/readme-visuals-and-llm-guide
Sep 14, 2026
Merged

itsarvinddev merged 3 commits into
masterfrom
docs/readme-visuals-and-llm-guide

Conversation

@itsarvinddev

@itsarvinddev itsarvinddev commented Sep 14, 2026

Copy link
Copy Markdown
Owner

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

  • Getting started in four steps: requirements, API key, per-platform setup in collapsible sections, and a first pick.
  • A section for each feature: picking modes, current location, search restriction, nearby places, embedding, the controller, reading the result, errors, localization, theming, customisation, and the standalone search field.
  • Configuration reference, API key security and costs, and troubleshooting.
  • Corrections:
    • The iOS AppDelegate snippet didn't match current Flutter templates.
    • Android was listed as API 21; google_maps_flutter_android needs 24.
  • Newly documented:
    • An embedded map inside a scroll view needs an EagerGestureRecognizer, or it won't receive drags.
    • Dark mode needs a mapStyle or cloudMapId, because Google's tiles don't switch automatically.

Screenshots

  • tool/screenshots renders 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.py adds device frames and builds the hero image.
  • Google's tiles can't load in a test, so the map is an illustration, and the README says so under the gallery.
  • A single WebP set serves both the README and pub.dev. The pub.dev gallery grows from 3 images to 8, and the archive shrinks from about 10 MB to 915 KB.
  • The README uses relative image paths. They render in this branch's preview, and pub.dev resolves them against the repository.

AI coding assistants

  • llms.txt: an authoritative 4.x API reference for language models.
  • Project rules to paste into CLAUDE.md, AGENTS.md, .github/copilot-instructions.md, .cursor/rules/*.mdc or GEMINI.md.
  • Seven copy-paste prompts: integrate, delivery step, embed, migrate from 3.x, localize with gen-l10n, debug empty search, and write tests.

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 (plus gen-l10n and flutter test where relevant), checked every identifier against lib/, and traced each failure back to the prompt text.

Prompt Round 1 Round 2
Integrate 8 10
Delivery step 8 8
Embed 8 9
Migrate 6 (compile error) 9
Localize 8 10
Troubleshoot 8 9
Tests 9 9

In round 2, all seven analyze clean and use no invented APIs. Round 1 found:

  • Migrate: searchConfig was moved inside MapLocationPickerConfig, which doesn't compile.
  • Several prompts: the assistant advised enabling the legacy "Places API".
  • Localize: the nearbyPlaces* strings were translated as "nearby places", but they label matching addresses.
  • Troubleshoot: it missed that a String.fromEnvironment key without --dart-define is empty.
  • Tests: it came close to using testWidgets, which fails on the controller's pending timer.

Both the prompts and llms.txt were 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)

  • Migration path: showMapLocationPicker threw when a 3.x-style onNext popped with a GeocodingResult. The route now accepts any popped value and still returns the PickedPlace.
  • Controller geocoder: a geocoder passed to MapLocationPickerController was silently replaced when the widget mounted.
  • Layout:
    • The back button and search field now share one row.
    • bottomCardTitle is aligned with the address below it.
    • The default search hint is no longer clipped next to the back button.

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 the pub downgrade pass.
  • flutter test: 89 passed on both SDKs. The screenshot harness renders on both.
  • Every Dart sample in the README compiles in example/lib/readme_samples.dart.
  • flutter pub publish --dry-run: no warnings except uncommitted files at the time.
  • pana: 160/160 with the eight new screenshots.

Pre-release audit (commit ca4ec43)

Before merging and 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.

  • First pass: 478 claims checked, and 22 findings survived an adversarial refutation step.
  • Second pass, over the corrections themselves: 106 claims checked, and 10 more survived.

The most important fixes:

  • iOS deployment target: apps created with Flutter 3.38 target iOS 13, but the Google Maps plugin needs 14, so pod install failed. This is now documented.
  • iOS snippet: it was shown as a complete AppDelegate.swift, and pasting it removed plugin registration. It now shows only the two additions.
  • Web script: the Maps script is now loaded synchronously, as google_maps_flutter_web documents. This applies to the README, llms.txt, the prompts and the example app.
  • Headers sample: it used dart:io Platform, which throws on web. The guidance now also covers the Geocoding API rejecting referrer-restricted keys.
  • Error kinds, documented per API: with Places (New), a wrong key arrives as invalidRequest. With the Geocoding API it arrives as requestDenied. An empty key fails search with unknown in debug builds.
  • Migration: the README section and prompt now follow 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

  • The README and the prompts reference ^4.0.1, and the prompts link to llms.txt on master. 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.
  • Not verified: web map gestures along the bottom strip under PointerInterceptor. This is unchanged from 4.0.0.

🤖 Generated with Claude Code

itsarvinddev and others added 2 commits September 14, 2026 17:52
…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>
Copilot AI lite review requested due to automatic review settings September 14, 2026 12:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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>
@itsarvinddev
itsarvinddev merged commit d4e18b5 into master Sep 14, 2026
8 checks passed
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.

2 participants