Skip to content

Commit

Permalink
feat(shake): add shake animation (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
MayuriXx authored Feb 18, 2022
1 parent 4c754a3 commit a72f479
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
14 changes: 1 addition & 13 deletions lib/view/puzzle_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,7 @@ class _PuzzlePageState extends State<PuzzlePage> {
super.initState();
_puzzleFocusNode = FocusNode();
detector = ShakeDetector.autoStart(onPhoneShake: () {
if (MediaQuery.of(context).orientation == Orientation.portrait) {
// is portrait
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
} else {
// is landscape
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitDown,
DeviceOrientation.portraitUp,
]);
}
_shuffle(context);
});
}

Expand Down
9 changes: 1 addition & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -662,7 +655,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.3"
timing:
dependency: transitive
description:
Expand Down

0 comments on commit a72f479

Please sign in to comment.