Skip to content

Move dartdoc examples to separate files #283

@jonasfj

Description

@jonasfj

As of recent dartdoc versions it's now possible to do:

/// My documentation string...
///
/// {@example /path/to/example/file.dart}
void someMethod() { ... }

Doing this makes it easy to run dart analyze on examples and use dart format on examples.

I propose that we refactor the current repository layout such that we have:

example/
  flutter_webcrypto_demo/
    ... everything that's currently in example/
  webcrypto/
    hmac/
      import_raw_key.dart
      ...
    <class>/
      <identifier>.dart

And then we use /// {@example /example/webcrypto/hmac/import_raw_key.dart} in our API docs.

This should not land as one large PR, please do:

  • One PR moving example/ to example/flutter_webcrypto_demo/
    • One commit that moves files
    • One commit that fixes CI
    • Any further cleanup of names, do that in an other PR
  • A PR for each primitive, so we don't have too big PRs to review

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions