Skip to content

Add abstract interface class examples - #7544

Merged
conooi merged 2 commits into
dart-lang:mainfrom
khanak0509:abstract-interface-example
Sep 30, 2026
Merged

conooi merged 2 commits into
dart-lang:mainfrom
khanak0509:abstract-interface-example

Conversation

@khanak0509

Copy link
Copy Markdown
Contributor

Adds a copy-pasteable abstract interface class example to the docs, as requested in #6510.

On the class modifiers page, the abstract interface section now has an a.dart / b.dart example. It shows the class can't be constructed or extended from another library, but can be implemented. The "Interfaces and abstract classes" section of the language tour also gets a small Launchable example, with a link to the full section.

Fixes #6510

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
  • This PR doesn't contain automatically generated corrections or text (Grammarly, LLMs, and similar).
  • This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn't use i.e. or e.g., and it avoids I and we (first person).
  • This PR uses semantic line breaks of 80 characters or fewer.
Contribution guidelines:
  • See our contributor guide for general expectations for PRs.
  • Larger or significant changes should be discussed in an issue before creating a PR.
  • Code changes should generally follow the Dart style guide and use dart format.
  • Updates to code excerpts indicated by <?code-excerpt need to be updated in their source .dart file as well.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds documentation and code examples for Dart's abstract interface class (pure interfaces), demonstrating that they cannot be instantiated or extended but can be implemented. The review feedback suggests a minor phrasing improvement in the documentation to more accurately describe an abstract interface class as a type of abstract class.

Comment thread src/content/language/index.md Resolved
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@conooi

conooi commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

/gcbrun

@dart-github-bot

Copy link
Copy Markdown
Collaborator

@conooi
conooi merged commit a01d0e7 into dart-lang:main Sep 30, 2026
17 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.

Add an example of abstract interface class to docs

3 participants