Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend typedefs to cover non-function types #66

Closed
mit-mit opened this issue Oct 31, 2018 · 2 comments
Closed

Extend typedefs to cover non-function types #66

mit-mit opened this issue Oct 31, 2018 · 2 comments
Labels
request Requests to resolve a particular developer problem

Comments

@mit-mit
Copy link
Member

mit-mit commented Oct 31, 2018

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>>;
@mit-mit mit-mit added the request Requests to resolve a particular developer problem label Oct 31, 2018
@mit-mit
Copy link
Member Author

mit-mit commented Oct 31, 2018

Sample issues from the Dart SDK repo: dart-lang/sdk#2626, #2952

@mit-mit
Copy link
Member Author

mit-mit commented Oct 8, 2021

This was completed via #65

@mit-mit mit-mit closed this as completed Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Requests to resolve a particular developer problem
Projects
None yet
Development

No branches or pull requests

1 participant