0 purchases
alarmplayer
alarmplayer #
alarmplayer is a very simple plugin to play sounds with their own volume, so that you can play critical alarms also when the phone is on silent mode.
Getting started #
To use this plugin :
Add dependency to your flutter project:
$ flutter pub add alarmplayer
copied to clipboard
or
dependencies:
alarmplayer: ^newest
copied to clipboard
Add following import to your code:
import 'package:alarmplayer/alarmplayer.dart';
copied to clipboard
Usage #
Instantiate an Alarmplayer instance
//...
Alarmplayer alarmplayer = Alarmplayer();
//...
copied to clipboard
Play alarm.
alarmplayer.Alarm(
url: "assets/alarm.mp3", // Path of sound file.
volume: 0.5, // optional, set the volume, default 1.
looping: true // optional, if you want to loop you're alarm or not
callback: () // this is the callback, it's getting executed if you're alarm
=> {print("i'm done!")} // is done playing. Note if you're alarm is on loop you're callback won't be executed
);
copied to clipboard
Stop alarm.
alarmplayer.stop(); // Stop alarm.
copied to clipboard
is playing?
alarmplayer.IsPlaying(); // returning a boolean if the alarm is currently playing.
copied to clipboard
Contribution #
Of course the project is open source, and you can contribute to it repository link
If you found a bug, open an issue.
If you have a feature request, open an issue.
If you want to contribute, submit a pull request.
Note for ios. #
currently there is no implementation for ios yet!
Made by Mrbluesky-ai.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.