Installation
This guide covers compatibility notes and how to add the flutter_tilt package.
Installation
1
Compatibility
Platforms compatibility
| Android | iOS | Web | macOS | Windows | Linux |
|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Sensors compatibility
Sensors are only available on these platforms.
Platforms without sensors support do not affect the normal use of other features.
| Android | iOS | Web (HTTPS) | macOS | Windows | Linux |
|---|---|---|---|---|---|
| ✅ | ✅ | Browser compatibility | ❌ | ❌ | ❌ |
Note:
Currently Web uses the Sensor API - Gyroscope, but it is not compatible with some of the major browsers, such as Safari, Firefox.
2
Add flutter_tilt
Versions compatibility
| Package | Flutter v3.0.0+ | Flutter v3.10.0+ | Flutter v3.19.0+ |
|---|---|---|---|
| flutter_tilt v3.0.0+ | ❌ | ❌ | ✅ |
| flutter_tilt v2.0.0+ | ❌ | ✅ | ✅ |
| flutter_tilt v1.0.0+ | ✅ | ❌ | ❌ |
Add flutter_tilt
Run this command with Flutter,
$ flutter pub add flutter_tilt
or add flutter_tilt to pubspec.yaml dependencies manually.
pubspec.yaml
...
dependencies:
flutter_tilt: latest_version
...
3
Import flutter_tilt
Now in your Dart code, you can use:
import 'package:flutter_tilt/flutter_tilt.dart';