fix: resolve flutter analyze errors - remove leaked code, fix method calls, cleanup imports
This commit is contained in:
@@ -53,21 +53,21 @@ final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
],
|
||||
),
|
||||
GoRoute(
|
||||
path: RouteNames.novelDetail,
|
||||
path: RouteNames.novelDetailPath,
|
||||
builder: (_, state) => NovelDetailScreen(
|
||||
novelId: state.uri.queryParameters['id'] ?? '',
|
||||
novelId: state.pathParameters['id'] ?? '',
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: RouteNames.reader,
|
||||
path: RouteNames.readerPath,
|
||||
builder: (_, state) => ReaderScreen(
|
||||
chapterId: state.uri.queryParameters['chapterId'] ?? '',
|
||||
chapterId: state.pathParameters['chapterId'] ?? '',
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: RouteNames.comments,
|
||||
path: RouteNames.commentsPath,
|
||||
builder: (_, state) => CommentsScreen(
|
||||
novelId: state.uri.queryParameters['novelId'] ?? '',
|
||||
novelId: state.pathParameters['novelId'] ?? '',
|
||||
chapterId: state.uri.queryParameters['chapterId'],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -6,10 +6,20 @@ class RouteNames {
|
||||
static const login = '/login';
|
||||
static const search = '/search';
|
||||
static const genres = '/genres';
|
||||
static const novelDetail = '/novel';
|
||||
static const reader = '/reader';
|
||||
static const bookshelf = '/bookshelf';
|
||||
static const comments = '/comments';
|
||||
static const profile = '/profile';
|
||||
static const settings = '/settings';
|
||||
|
||||
// Path-param based routes
|
||||
static const novelDetailPath = '/novel/:id';
|
||||
static const readerPath = '/reader/:chapterId';
|
||||
static const commentsPath = '/comments/:novelId';
|
||||
|
||||
// Navigation helpers
|
||||
static String novelDetail(String id) => '/novel/$id';
|
||||
static String readerChapter(String chapterId) => '/reader/$chapterId';
|
||||
static String commentsFor(String novelId, {String? chapterId}) {
|
||||
final base = '/comments/$novelId';
|
||||
return chapterId != null ? '$base?chapterId=$chapterId' : base;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user