Skip to content

Plan: locale switcher pattern is underspecified for non-trivial app trees #8

@ChauCM

Description

@ChauCM

Surfaced by a second pilot (Claude Sonnet 4.6 against examples/after/, 2026-05-24). Full feedback: examples/after/dialect-feedback.md.

Problem

Phase 1.4 of the init plan says: "wire it to a Locale? state above MaterialApp." For the pilot agent, this meant:

  • Changing ExampleApp from StatelessWidget to StatefulWidget
  • Adding a Locale? _locale field and a _setLocale callback
  • Threading onLocaleChanged as a constructor parameter through HomeScreenSettingsScreen

That works for a 3-screen demo. In a real app where Settings sits several navigation hops below MaterialApp, an agent following the plan verbatim may either thread the callback through too many layers or reach for an unrelated state-management package.

Suggested addition (terse)

A two-sentence note in Phase 1.4: prop-drilling via callbacks is the idiomatic answer for small trees; for deeper trees use InheritedWidget or whatever state-management package the app already uses (provider, riverpod, …). Dialect has no opinion on which.

Acceptance

  • Phase 1.4 acknowledges the two patterns without recommending a specific package.
  • Plan stays terse — this is one paragraph, not a tutorial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions