getDisplayString abstract method

  1. @override
String getDisplayString({
  1. @Deprecated('Only non-nullable by default mode is supported') bool withNullability = true,
})

Return the presentation of this type as it should appear when presented to users in contexts such as error messages.

If withNullability is true, then NullabilitySuffix.question and NullabilitySuffix.star will be represented as ? and *. NullabilitySuffix.none does not have any explicit presentation.

If withNullability is false, nullability suffixes will not be included into the presentation.

Clients should not depend on the content of the returned value as it will be changed if doing so would improve the UX.

Implementation

@override
String getDisplayString({
  @Deprecated('Only non-nullable by default mode is supported')
  bool withNullability = true,
});