-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplash_screen.dart
More file actions
63 lines (54 loc) · 1.55 KB
/
Copy pathsplash_screen.dart
File metadata and controls
63 lines (54 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import 'package:flutter/material.dart';
import 'package:working_router/working_router.dart';
import 'alphabet_sidebar_screen.dart';
import 'nested_screen.dart';
import 'responsive.dart';
import 'route_nodes.dart';
final aRouteNodeId = RouteNodeId<ARouteNode>();
class SplashRouteNode extends Location<SplashRouteNode> {
final ScreenSize screenSize;
final WorkingRouterKey rootRouterKey;
SplashRouteNode({
super.id,
super.parentRouterKey,
required this.screenSize,
required this.rootRouterKey,
});
@override
void build(LocationBuilder builder) {
builder.content = Content.widget(const SplashScreen());
builder.children = [
Shell(
navigatorEnabled: screenSize != ScreenSize.small,
build: (builder, shell, routerKey) {
builder.content = ShellContent.builder(
(context, data, child) => NestedScreen(child: child),
);
builder.children = [
ARouteNode(
id: aRouteNodeId,
rendersStandaloneSidebar: screenSize == ScreenSize.small,
rootRouterKey: rootRouterKey,
outerShellRouterKey: routerKey,
),
];
},
),
];
}
}
class SplashScreen extends StatelessWidget {
const SplashScreen({super.key});
@override
Widget build(BuildContext context) {
final router = WorkingRouter.of(context);
return Scaffold(
body: Center(
child: FilledButton(
onPressed: router.routeToA,
child: const Text('Splash screen'),
),
),
);
}
}