flutter: windows: Do not init audio player

This commit is contained in:
Calcitem 2021-05-01 21:13:13 +08:00
parent 2d6a23573a
commit fbdbd2b7f2
2 changed files with 7 additions and 4 deletions

View File

@ -29,7 +29,6 @@ import 'package:sanmill/services/audios.dart';
import 'package:sanmill/style/app_theme.dart';
import 'package:sanmill/widgets/navigation_home_screen.dart';
//import 'common/config.dart';
import 'services/audios.dart';
Future<void> main() async {
@ -108,7 +107,12 @@ class _SanmillAppState extends State<SanmillApp> {
@override
void initState() {
super.initState();
Audios.loadSounds();
if (Platform.isWindows) {
print("audio players is not support Windows.");
return;
} else {
Audios.loadSounds();
}
}
@override

View File

@ -90,8 +90,7 @@ class Audios {
}
if (Platform.isWindows) {
print(
"audio players is not support Windows. See: https://pub.dev/packages/just_audio");
print("audio players is not support Windows.");
return;
}