canWriteType abstract method

bool canWriteType(
  1. DartType? type, {
  2. ExecutableElement? methodBeingCopied,
})

Check if the code for a type annotation for the given type can be written.

If a methodBeingCopied is provided, then type parameters defined by that method are assumed to be part of what is being written and hence valid types.

Implementation

bool canWriteType(DartType? type, {ExecutableElement? methodBeingCopied});