Skip to content

Extend typedefs to cover non-function types #66

@mit-mit

Description

@mit-mit

dart-lang/sdk#27527 added support for generic typedefs, [which support[(https://github.com/dart-lang/sdk/blob/master/docs/language/informal/generic-function-type-alias.md) type aliases for function types, e.g.:

typedef F = List<T> Function<T>(T);

A sample usage of that is to provide named callbacks in the Flutter framework:

/// Signature for callbacks that report that an underlying value has changed.
///
/// See also [ValueSetter].
typedef ValueChanged<T> = void Function(T value);

The present issue tracks extending this functionality with the ability to create type aliases for non-function types, so that we can create type aliases such as:

typedef JsonMessage = Map<String, Object);
typedef ClientNoteList = Map<String, List<ClientNote>>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    requestRequests to resolve a particular developer problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions