mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-22 06:08:54 -04:00
move keyboard shortcuts into own file
This commit is contained in:
parent
d6b1c20906
commit
6830b54ce8
4 changed files with 19 additions and 70 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../../keyboard_shortcuts.dart';
|
||||
import '../../notifications/notifications.dart';
|
||||
|
||||
class RouterShell extends StatelessWidget {
|
||||
const RouterShell({required Widget child, super.key}) : _child = child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => NotificationsWidget(child: _child);
|
||||
Widget build(BuildContext context) =>
|
||||
NotificationsWidget(child: KeyboardShortcuts(child: _child));
|
||||
|
||||
final Widget _child;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue