Closed
Description
Steps to reproduce
- make router file with go_router_builder ^3.0.0 and go_router ^15.1.3
- run in terminal "dart run build_runner build -d"
The resulting file produces a warning "Getter does not override inherited getter." I get this warning in every mixin of the GoRouteData class such as in the location, go, push, and other functions. Although this does not make the application crash, I want my code to be clean.
Expected results
result
Actual results
The getter doesn't override an inherited getter.
Try updating this class to match the superclass, or removing the override annotation.
Code sample
Code sample
@TypedGoRoute<SplashRoute>(path: Routes.splash)
class SplashRoute extends GoRouteData with _$SplashRoute{
const SplashRoute();
static final $parentNavigatorKey = _rootNavigatorKey;
@override
Widget build(BuildContext context, GoRouterState state) => const SplashScreen();
}
// in router.g.dart
RouteBase get $splashRoute => GoRouteData.$route(
path: '/',
parentNavigatorKey: SplashRoute.$parentNavigatorKey,
factory: _$SplashRoute._fromState,
);
mixin _$SplashRoute on GoRouteData {
static SplashRoute _fromState(GoRouterState state) => const SplashRoute();
@override
String get location => GoRouteData.$location(
'/',
);
@override
void go(BuildContext context) => context.go(location);
@override
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
@override
void pushReplacement(BuildContext context) =>
context.pushReplacement(location);
@override
void replace(BuildContext context) => context.replace(location);
}
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.2, on macOS 13.7.6 22H625 darwin-x64, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.3.2.2)
[✓] VS Code (version 1.100.3)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
Metadata
Metadata
Assignees
Labels
Found to occur in 3.32Found to occur in 3.33flutter/packages/flutter repository. See also f: labels.The issue has been confirmed reproducible and is ready to work onThe go_router_builder packageflutter/packages repository. See also p: labels.Issue is closed as already fixed in a newer versionOwned by Framework team