♻️ Refactor router, moved from auto_router to go_router

This commit is contained in:
2025-06-26 14:13:44 +08:00
parent 825e6b5b6d
commit f2829b2012
67 changed files with 587 additions and 2876 deletions

View File

@ -7,7 +7,9 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:island/main.dart';
import 'package:island/route.dart';
import 'package:island/models/user.dart';
import 'package:island/pods/websocket.dart';
import 'package:island/widgets/app_notification.dart';
@ -30,7 +32,7 @@ StreamSubscription<WebSocketPacket> setupNotificationListener(
var uri = notification.meta['action_uri'] as String;
if (uri.startsWith('/')) {
// In-app routes
appRouter.pushPath(notification.meta['action_uri']);
rootNavigatorKey.currentContext?.push(notification.meta['action_uri']);
} else {
// External URLs
launchUrlString(uri);

View File

@ -22,14 +22,11 @@ mixin _$Tour {
@pragma('vm:prefer-inline')
$TourCopyWith<Tour> get copyWith => _$TourCopyWithImpl<Tour>(this as Tour, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is Tour&&(identical(other.id, id) || other.id == id)&&(identical(other.isStartup, isStartup) || other.isStartup == isStartup));
}
@override
int get hashCode => Object.hash(runtimeType,id,isStartup);
@ -38,7 +35,6 @@ String toString() {
return 'Tour(id: $id, isStartup: $isStartup)';
}
}
/// @nodoc
@ -49,9 +45,6 @@ $Res call({
String id, bool isStartup
});
}
/// @nodoc
class _$TourCopyWithImpl<$Res>
@ -73,10 +66,8 @@ as bool,
}
/// @nodoc
class _Tour extends Tour {
const _Tour({required this.id, required this.isStartup}): super._();
@ -90,14 +81,11 @@ class _Tour extends Tour {
@pragma('vm:prefer-inline')
_$TourCopyWith<_Tour> get copyWith => __$TourCopyWithImpl<_Tour>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Tour&&(identical(other.id, id) || other.id == id)&&(identical(other.isStartup, isStartup) || other.isStartup == isStartup));
}
@override
int get hashCode => Object.hash(runtimeType,id,isStartup);
@ -106,7 +94,6 @@ String toString() {
return 'Tour(id: $id, isStartup: $isStartup)';
}
}
/// @nodoc
@ -117,9 +104,6 @@ $Res call({
String id, bool isStartup
});
}
/// @nodoc
class __$TourCopyWithImpl<$Res>
@ -139,7 +123,6 @@ as bool,
));
}
}
// dart format on