flutter_ringtone_player
A simple ringtone, alarm & notification player plugin.
Usage
Add following import to your code:
import 'package:flutter_ringtone_player/flutter_ringtone_player.dart';
Then simply call this to play system default notification sound:
FlutterRingtonePlayer.playNotification();
There's also this generic method allowing you to specify in detail what kind of ringtone should be played:
FlutterRingtonePlayer.play(
android: AndroidSounds.notification,
ios: IosSounds.glass,
looping: true, // Android only - API >= 28
volume: 0.1, // Android only - API >= 28
asAlarm: false, // Android only - all APIs
);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…