Skip to content

Make generated Dart and Flutter method examples analyze cleanly #2091

Closed

Description

@ChiragAgg5k

Tracks PR #2090.

Plan

Goal: Generated Dart and Flutter method examples should pass dart analyze, and CI should keep them that way.

What changes:

  • templates/dart/docs/example.md.twig and templates/flutter/docs/example.md.twig: drop the permission.dart / role.dart imports (they are part of the main library, so analyze reports import_of_non_library), import dart:typed_data for Dart location examples, drop the unused dart:io import from upload examples (Flutter keeps it for location examples), and stop rendering models. result = / models.Any result = for methods with no response model or an any response (await without a typed result, or use dynamic).
  • New scripts/validate-dart-examples.sh: pulls the code block out of every generated docs example, wraps it in main(), and runs dart analyze --fatal-warnings inside the generated package.
  • .github/workflows/validation.yml: the dart and flutter validation jobs run that script after analyzing the SDK, like validate-go-examples.sh does for Go.

Remaining steps: None. The linked PR is the full change.

Done when:

Activity

  1. self-assigned this
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions