🐛 Fix bugs on windows

This commit is contained in:
LittleSheep 2024-08-30 19:53:53 +08:00
parent b7b673c96d
commit 1ac7704080
3 changed files with 20 additions and 17 deletions

View File

@ -52,11 +52,11 @@ Future<void> main(List<String> rawArgs) async {
await KVStoreService.initialize(); await KVStoreService.initialize();
await EncryptedKvStoreService.initialize(); await EncryptedKvStoreService.initialize();
runApp(const MyApp()); runApp(const RhythmApp());
} }
class MyApp extends StatelessWidget { class RhythmApp extends StatelessWidget {
const MyApp({super.key}); const RhythmApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rhythm_box/platform.dart'; import 'package:rhythm_box/platform.dart';
import 'package:window_manager/window_manager.dart';
class SystemShell extends StatelessWidget { class SystemShell extends StatelessWidget {
final Widget child; final Widget child;
@ -8,19 +9,21 @@ class SystemShell extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (PlatformInfo.isMacOS) { if (PlatformInfo.isDesktop) {
return Column( return DragToMoveArea(
children: [ child: Column(
Container( children: [
height: 28, Container(
color: Theme.of(context).colorScheme.surface, height: 28,
), color: Theme.of(context).colorScheme.surface,
const Divider( ),
thickness: 0.3, const Divider(
height: 0.3, thickness: 0.3,
), height: 0.3,
Expanded(child: child), ),
], Expanded(child: child),
],
),
); );
} }

View File

@ -13,7 +13,7 @@ import 'package:rhythm_box/main.dart';
void main() { void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async { testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame. // Build our app and trigger a frame.
await tester.pumpWidget(const MyApp()); await tester.pumpWidget(const RhythmApp());
// Verify that our counter starts at 0. // Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget); expect(find.text('0'), findsOneWidget);