@@ -3,9 +3,6 @@ import 'package:fluent_ui/fluent_ui.dart';
3
3
4
4
import '../../main.dart' ;
5
5
6
- import '../../routes/welcome.dart' as welcome;
7
- import '../../providers/library_manager.dart' ;
8
-
9
6
import '../../screens/bsod/bsod.dart' ;
10
7
11
8
import '../../widgets/navigation_bar/flip_animation.dart' ;
@@ -48,103 +45,88 @@ class _RuneRouterFrameImplementationState
48
45
final r = Provider .of <ResponsiveProvider >(context);
49
46
final crash = Provider .of <CrashProvider >(context);
50
47
51
- return Selector <LibraryManagerProvider , bool >(
52
- selector: (_, libraryManager) {
53
- final scanProgress =
54
- libraryManager.getScanTaskProgress (library.currentPath);
55
- final scanning = scanProgress? .status == TaskStatus .working;
56
-
57
- return scanning && (scanProgress? .initialize ?? false );
58
- },
59
- builder: (context, scanning, child) {
60
- final isCar = r.smallerOrEqualTo (DeviceType .car, false );
61
- final isZune = r.smallerOrEqualTo (DeviceType .zune, false );
62
- final diskOnRight = r.smallerOrEqualTo (DeviceType .car, false );
63
-
64
- final showDisk = isZune || isCar;
65
-
66
- if (crash.report != null ) {
67
- return Bsod (report: crash.report! );
68
- }
69
-
70
- if (scanning) {
71
- return const welcome.ScanningPage ();
72
- }
73
-
74
- if (library.currentPath == null ) {
75
- return Container ();
76
- }
77
-
78
- final mainContent = FocusTraversalOrder (
79
- order: const NumericFocusOrder (2 ),
80
- child: widget.child,
81
- );
82
-
83
- final path = Provider .of <RouterPathProvider >(context).path;
84
-
85
- return Stack (
86
- children: [
87
- if (! disableBrandingAnimation) const BrandingAnimation (),
88
- ScaleFadeContainer (
89
- delay: disableBrandingAnimation
90
- ? const Duration (milliseconds: 0 )
91
- : const Duration (milliseconds: 4350 ),
92
- duration: disableBrandingAnimation
93
- ? const Duration (milliseconds: 200 )
94
- : const Duration (milliseconds: 500 ),
95
- child: FlipAnimationContext (
96
- child: FocusTraversalGroup (
97
- policy: OrderedTraversalPolicy (),
98
- child: RuneStack (
99
- alignment: diskOnRight
100
- ? Alignment .centerRight
101
- : Alignment .bottomCenter,
102
- children: [
103
- if (path == '/cover_wall' && ! showDisk) mainContent,
104
- if (! showDisk)
105
- const FocusTraversalOrder (
106
- order: NumericFocusOrder (3 ),
107
- child: PlaybackController (),
108
- ),
109
- FocusTraversalOrder (
110
- order: const NumericFocusOrder (1 ),
111
- child: DeviceTypeBuilder (
112
- deviceType: const [
113
- DeviceType .band,
114
- DeviceType .dock,
115
- DeviceType .tv
116
- ],
117
- builder: (context, activeBreakpoint) {
118
- final isSmallView =
119
- activeBreakpoint == DeviceType .band ||
120
- activeBreakpoint == DeviceType .dock;
121
-
122
- if (! isSmallView) {
123
- return NavigationBar (path: path);
124
- }
125
-
126
- return const Positioned (
127
- top: - 12 ,
128
- left: - 12 ,
129
- child: NavigationBackButton (),
130
- );
131
- },
132
- ),
133
- ),
134
- if (! (path == '/cover_wall' && ! showDisk)) mainContent,
135
- if (showDisk)
136
- const FocusTraversalOrder (
137
- order: NumericFocusOrder (4 ),
138
- child: CoverArtDisk (),
139
- ),
140
- ],
48
+ final isCar = r.smallerOrEqualTo (DeviceType .car, false );
49
+ final isZune = r.smallerOrEqualTo (DeviceType .zune, false );
50
+ final diskOnRight = r.smallerOrEqualTo (DeviceType .car, false );
51
+
52
+ final showDisk = isZune || isCar;
53
+
54
+ if (crash.report != null ) {
55
+ return Bsod (report: crash.report! );
56
+ }
57
+
58
+ if (library.currentPath == null ) {
59
+ return Container ();
60
+ }
61
+
62
+ final mainContent = FocusTraversalOrder (
63
+ order: const NumericFocusOrder (2 ),
64
+ child: widget.child,
65
+ );
66
+
67
+ final path = Provider .of <RouterPathProvider >(context).path;
68
+
69
+ return Stack (
70
+ children: [
71
+ if (! disableBrandingAnimation) const BrandingAnimation (),
72
+ ScaleFadeContainer (
73
+ delay: disableBrandingAnimation
74
+ ? const Duration (milliseconds: 0 )
75
+ : const Duration (milliseconds: 4350 ),
76
+ duration: disableBrandingAnimation
77
+ ? const Duration (milliseconds: 200 )
78
+ : const Duration (milliseconds: 500 ),
79
+ child: FlipAnimationContext (
80
+ child: FocusTraversalGroup (
81
+ policy: OrderedTraversalPolicy (),
82
+ child: RuneStack (
83
+ alignment: diskOnRight
84
+ ? Alignment .centerRight
85
+ : Alignment .bottomCenter,
86
+ children: [
87
+ if (path == '/cover_wall' && ! showDisk) mainContent,
88
+ if (! showDisk)
89
+ const FocusTraversalOrder (
90
+ order: NumericFocusOrder (3 ),
91
+ child: PlaybackController (),
92
+ ),
93
+ FocusTraversalOrder (
94
+ order: const NumericFocusOrder (1 ),
95
+ child: DeviceTypeBuilder (
96
+ deviceType: const [
97
+ DeviceType .band,
98
+ DeviceType .dock,
99
+ DeviceType .tv
100
+ ],
101
+ builder: (context, activeBreakpoint) {
102
+ final isSmallView =
103
+ activeBreakpoint == DeviceType .band ||
104
+ activeBreakpoint == DeviceType .dock;
105
+
106
+ if (! isSmallView) {
107
+ return NavigationBar (path: path);
108
+ }
109
+
110
+ return const Positioned (
111
+ top: - 12 ,
112
+ left: - 12 ,
113
+ child: NavigationBackButton (),
114
+ );
115
+ },
116
+ ),
141
117
),
142
- ),
118
+ if (! (path == '/cover_wall' && ! showDisk)) mainContent,
119
+ if (showDisk)
120
+ const FocusTraversalOrder (
121
+ order: NumericFocusOrder (4 ),
122
+ child: CoverArtDisk (),
123
+ ),
124
+ ],
143
125
),
144
126
),
145
- ] ,
146
- );
147
- } ,
127
+ ) ,
128
+ ),
129
+ ] ,
148
130
);
149
131
}
150
132
}
0 commit comments