Skip to content

Commit

Permalink
✨feat(wake): 屏幕常亮
Browse files Browse the repository at this point in the history
  • Loading branch information
summerscar committed Nov 4, 2020
1 parent aed136d commit 1f5a475
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import './component/indactor.dart';
import 'dart:async';
import 'package:assets_audio_player/assets_audio_player.dart';
import './component/summerscar.dart';
import 'package:wakelock/wakelock.dart';

void main() {
runApp(MyApp());
Expand Down Expand Up @@ -69,7 +70,6 @@ class _MyHomePageState extends State<MyHomePage>
Future<void> _playAudio() {
int nextStep = _nowStep + 1;
if (nextStep % 4 == 0) {
print('first');
return assetsAudioPlayer.open(Audio('assets/metronome1.mp3'));
} else {
return assetsAudioPlayer.open(Audio('assets/metronome2.mp3'));
Expand All @@ -86,7 +86,7 @@ class _MyHomePageState extends State<MyHomePage>
@override
void initState() {
super.initState();
// runTimer();
Wakelock.enable();
_animationController =
AnimationController(vsync: this, duration: Duration(milliseconds: 300));
}
Expand Down
42 changes: 42 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.5"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.16.2"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -114,6 +121,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
html:
dependency: transitive
description:
name: html
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.14.0+4"
http:
dependency: transitive
description:
Expand All @@ -128,6 +142,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.4"
import_js_library:
dependency: transitive
description:
name: import_js_library
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
intl:
dependency: transitive
description:
Expand Down Expand Up @@ -350,6 +371,27 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0-nullsafety.3"
wakelock:
dependency: "direct main"
description:
name: wakelock
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.1"
wakelock_platform_interface:
dependency: transitive
description:
name: wakelock_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.0+1"
wakelock_web:
dependency: transitive
description:
name: wakelock_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.0+2"
win32:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ dependencies:
sleek_circular_slider: 1.2.0+web
assets_audio_player: 2.0.12
url_launcher: 5.7.8
wakelock: 0.2.1

dev_dependencies:
flutter_test:
sdk: flutter
Expand Down

0 comments on commit 1f5a475

Please sign in to comment.