move keyboard shortcuts into own file

This commit is contained in:
Christien Rioux 2025-03-23 10:41:19 -04:00
parent d6b1c20906
commit 6830b54ce8
4 changed files with 19 additions and 70 deletions

View file

@ -16,6 +16,8 @@ import '../../tools/tools.dart';
import '../../veilid_processor/views/developer.dart';
import '../views/router_shell.dart';
export 'package:go_router/go_router.dart';
part 'router_cubit.freezed.dart';
part 'router_cubit.g.dart';
@ -164,3 +166,14 @@ class RouterCubit extends Cubit<RouterState> {
_accountRepositorySubscription;
GoRouter? _router;
}
extension GoRouterExtension on GoRouter {
String location() {
final lastMatch = routerDelegate.currentConfiguration.last;
final matchList = lastMatch is ImperativeRouteMatch
? lastMatch.matches
: routerDelegate.currentConfiguration;
final location = matchList.uri.toString();
return location;
}
}