Search packages, repositories and app categories

Package detailsv4.0.0+4

flutter_ringtone_player

A simple player for system default ringtones, alarms and notifications

AndroidiOS
30-day downloads
2.6K
Likes
287
Pub points
150

Install package

flutter pub add flutter_ringtone_player

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A lightweight Flutter package that enables playback of system default ringtones, alarms, and notifications on Android and iOS devices. It provides a simple API to access and play built-in sound assets without requiring external file handling. Ideal for apps needing to trigger device-specific audio cues, such as reminders, alerts, or notification sounds. The package integrates seamlessly with native platform audio systems and supports both platforms with minimal configuration.

Use cases

  • Playing system ringtones in reminder apps
  • Triggering alarm sounds in task management tools
  • Reproducing notification tones in messaging apps
  • Simulating device alert sounds in utility apps
  • Enabling silent mode fallbacks with ringtone playback

Key features

  • Access to system default ringtones
  • Support for Android and iOS
  • Minimal setup and integration
  • Cross-platform compatibility
  • Simple playback control API

Suitable for

  • Developers building reminder or alert apps
  • Apps requiring native notification sounds
  • Utility tools needing device audio feedback
  • Mobile apps targeting both Android and iOS

Considerations

  • Requires appropriate platform permissions
  • Limited to system-provided audio resources
  • No support for custom ringtone files
  • Behavior may vary slightly between Android and iOS
  • Depends on native system audio availability

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_ringtone_player

A simple ringtone, alarm & notification player plugin.

pub package flutter

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
);

Also you can specify a custom ringtone from assets, or provide direct path to file that works for both Android and iOS:

FlutterRingtonePlayer().play(fromAsset: "assets/ringtone.wav");  
FlutterRingtonePlayer().play(fromFile: "assets/ringtone.wav");  

You can specify a platform specific ringtone and it will override the one from assets:

FlutterRingtonePlayer().play(  
 fromAsset: "assets/ringtone.wav", // will be the sound on Android
 ios: IosSounds.glass 			   // will be the sound on iOS
 );  
.play() optional attributes
Attribute Description
bool looping Enables looping of ringtone. Requires FlutterRingtonePlayer().stop(); to stop ringing.
double volume Sets ringtone volume in range 0 to 1.0.
bool asAlarm Allows to ignore device's silent/vibration mode and play given sound anyway.

To stop looped ringtone please use:

FlutterRingtonePlayer().stop();

Above works only on Android, and please note that by default Alarm & Ringtone sounds are looped.

Default sounds

Method Android iOS
playAlarm RingtoneManager.TYPE_ALARM IosSounds.alarm
playNotification RingtoneManager.TYPE_NOTIFICATION IosSounds.triTone
playRingtone RingtoneManager.TYPE_RINGTONE IosSounds.electronic
Note on iOS sounds

If you want to use any other sound on iOS you can always specify a valid Sound ID and manually construct [IosSound]:

FlutterRingtonePlayer().play(
  android: AndroidSounds.notification,
  ios: const IosSound(1023),
  looping: true,
  volume: 0.1,
);

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package