Skip to content

Commit

Permalink
Disable Tilt Effect on Mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
PLGuerraDesigns committed Aug 12, 2024
1 parent 6db9b52 commit 8f522f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.6.1

- REVISED: Disabled the tilt effect on mobile devices.

## 2.6.0

- NEW: Added a tilt effect `TiltHandler` to the floating thumbnail and project thumbnail.
Expand Down
7 changes: 7 additions & 0 deletions lib/widgets/tilt_handler.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:math' as math;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_tilt/flutter_tilt.dart';

Expand Down Expand Up @@ -86,6 +87,12 @@ class _TiltHandlerState extends State<TiltHandler>

@override
Widget build(BuildContext context) {
// Omit the tilt effect on mobile platforms.
if (defaultTargetPlatform == TargetPlatform.android ||
defaultTargetPlatform == TargetPlatform.iOS) {
return widget.child;
}

return Tilt(
tiltStreamController: tiltStreamController,
tiltConfig: TiltConfig(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: plg_portfolio
description: Pablo L. Guerra's web-app portfolio powered by Flutter.
publish_to: "none"
version: 2.6.0+60
version: 2.6.1+61

environment:
sdk: ">=3.1.1 <4.0.0"
Expand Down

0 comments on commit 8f522f3

Please sign in to comment.