all_vibrate 0.0.2 copy "all_vibrate: ^0.0.2" to clipboard
all_vibrate: ^0.0.2 copied to clipboard

PlatformAndroid

A flutter package for implementing vibrations in android. It provides a function for making a simple vibration and another function for creating your very own custom vibration

example/lib/main.dart

import 'package:all_vibrate/all_vibrate.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    final vibrate = AllVibrate();
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              ElevatedButton(
                child: const Text('Simple vibrate'),
                onPressed: () {
                  vibrate.simpleVibrate(period: 1500, amplitude: 200);
                },
              ),
              ElevatedButton(
                onPressed: () {
                  vibrate.waveForm(
                    timings: [102, 303, 983, 332],
                    amplitudes: [100, 150, 49, 100],
                  );
                },
                child: const Text('Waveform'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
5
likes
160
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package for implementing vibrations in android. It provides a function for making a simple vibration and another function for creating your very own custom vibration

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on all_vibrate