Skip to content

Commit c1ccc09

Browse files
authored
Fix home route window frame for intro flow (#1136)
1 parent 5443ef4 commit c1ccc09

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

lib/app.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import 'package:server_box/view/page/home.dart';
1212

1313
part 'intro.dart';
1414

15+
Widget _buildHomeWithWindowFrame() {
16+
return VirtualWindowFrame(title: BuildData.name, child: const HomePage());
17+
}
18+
1519
class MyApp extends StatefulWidget {
1620
const MyApp({super.key});
1721

@@ -136,17 +140,20 @@ class _MyAppState extends State<MyApp> {
136140
if (appL10n != null) l10n = appL10n;
137141

138142
Widget child;
143+
var hasWindowFrame = false;
139144
if (snapshot.connectionState == ConnectionState.waiting) {
140145
child = const Scaffold(body: Center(child: CircularProgressIndicator()));
141146
} else {
142147
final intros = snapshot.data ?? [];
143148
if (intros.isNotEmpty) {
144149
child = _IntroPage(intros);
145150
} else {
146-
child = const HomePage();
151+
child = _buildHomeWithWindowFrame();
152+
hasWindowFrame = true;
147153
}
148154
}
149155

156+
if (hasWindowFrame) return child;
150157
return VirtualWindowFrame(title: BuildData.name, child: child);
151158
},
152159
),

lib/intro.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class _IntroPage extends StatelessWidget {
1818
pages: pages_,
1919
onDone: (ctx) {
2020
Stores.setting.introVer.put(BuildData.build);
21-
Navigator.of(ctx).pushReplacement(MaterialPageRoute(builder: (_) => const HomePage()));
21+
Navigator.of(ctx).pushReplacement(MaterialPageRoute(builder: (_) => _buildHomeWithWindowFrame()));
2222
},
2323
),
2424
);

0 commit comments

Comments
 (0)