Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/go_router_builder/lib/src/route_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ abstract class RouteBaseConfig {
}) {
assert(!reader.isNull, 'reader should not be null');
final InterfaceType type = reader.objectValue.type! as InterfaceType;
// ignore: experimental_member_use
final String typeName = type.element.displayName;

if (isAncestorRelative && typeName == 'TypedGoRoute') {
Expand Down Expand Up @@ -942,6 +943,7 @@ $routeDataClassName.$dataConvertionFunctionName(
String _enumMapConst(InterfaceType type) {
assert(type.isEnum);

// ignore: experimental_member_use
final String enumName = type.element.displayName;

final StringBuffer buffer = StringBuffer('const ${enumMapName(type)} = {');
Expand Down
5 changes: 5 additions & 0 deletions packages/go_router_builder/lib/src/type_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,11 @@ String compareField(

/// Gets the name of the `const` map generated to help encode [Enum] types.
String enumMapName(InterfaceType type) =>
// ignore: experimental_member_use
'_\$${type.element.displayName}EnumMap';

/// Gets the name of the `const` map generated to help encode [Json] types.
// ignore: experimental_member_use
String jsonMapName(InterfaceType type) => type.element.displayName;

String _stateValueAccess(
Expand Down Expand Up @@ -795,9 +797,12 @@ class _TypeHelperJson extends _TypeHelperWithHelper {
}

final FunctionType functionType = secondParam.type as FunctionType;
// ignore: experimental_member_use
if (functionType.formalParameters.length != 1 ||
functionType.returnType.getDisplayString() !=
// ignore: experimental_member_use
type.element.typeParameters.first.displayName ||
// ignore: experimental_member_use
functionType.formalParameters[0].type.getDisplayString() != 'Object?') {
throw InvalidGenerationSourceError(
'The parameter type '
Expand Down