flutter_system_ringtones_advanced 1.0.0 copy "flutter_system_ringtones_advanced: ^1.0.0" to clipboard
flutter_system_ringtones_advanced: ^1.0.0 copied to clipboard

Retrieve system ringtones, alarms, and notification sounds on Android and iOS (WIP).

flutter_system_ringtones_advanced #

pub package License: MIT

A Flutter plugin to list system ringtones, alarms, and notification sounds using native APIs on Android. iOS listing is not implemented yet and returns empty lists.

Community-maintained fork of imedboumalek/flutter_system_ringtones, republished as flutter_system_ringtones_advanced on pub.dev because the upstream maintainer is no longer accepting pull requests.

Installation #

Add flutter_system_ringtones_advanced to your pubspec.yaml:

dependencies:
  flutter_system_ringtones_advanced: ^1.0.0

Then run:

flutter pub get

Migrating from flutter_system_ringtones #

Replace the dependency and update imports:

# Before
# flutter_system_ringtones: ^0.0.6

dependencies:
  flutter_system_ringtones_advanced: ^1.0.0
// Before
// import 'package:flutter_system_ringtones/flutter_system_ringtones.dart';

import 'package:flutter_system_ringtones_advanced/flutter_system_ringtones_advanced.dart';

The Dart API (FlutterSystemRingtones, Ringtone) is unchanged; only the package name and import path differ.

Requirements #

Minimum
Dart 3.0+
Flutter 3.10+
Android API 16+
iOS 13.0+

Usage #

Import the package:

import 'package:flutter_system_ringtones_advanced/flutter_system_ringtones_advanced.dart';

List ringtones #

final List<Ringtone> ringtones =
    await FlutterSystemRingtones.getRingtoneSounds();

for (final ringtone in ringtones) {
  print('${ringtone.title} → ${ringtone.uri}');
}

List alarm sounds #

final List<Ringtone> alarms =
    await FlutterSystemRingtones.getAlarmSounds();

List notification sounds #

final List<Ringtone> notifications =
    await FlutterSystemRingtones.getNotificationSounds();

All three methods return an empty list when the platform has no sounds or when the native side returns nothing (never null).

Ringtone model #

Each item has:

Field Type Description
id String System sound ID
title String Display name
uri String Content URI you can pass to a media player

Ringtone implements Equatable and supports copyWith, toJson / fromJson, and toEncodedJson / fromEncodedJson.

final encoded = ringtone.toEncodedJson();
final restored = Ringtone.fromEncodedJson(encoded);

Platform support #

Feature Android iOS
Ringtones Supported Not implemented (empty list)
Alarms Supported Not implemented (empty list)
Notifications Supported Not implemented (empty list)

On Android, sounds are loaded via RingtoneManager when the plugin attaches to the engine. No extra permissions are required for listing built-in tones.

iOS #

Dynamic system sound listing on iOS is not implemented in this release. Calls succeed but return []. See GitHub issues for progress.

Example #

See the example app for a simple list UI that loads ringtones on Android.

cd example
flutter run

Issues #

Please file bugs and feature requests on GitHub.

License #

MIT — see LICENSE. Original work Copyright (c) 2022 Imed Boumalek.

2
likes
150
points
134
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Retrieve system ringtones, alarms, and notification sounds on Android and iOS (WIP).

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

equatable, flutter, plugin_platform_interface

More

Packages that depend on flutter_system_ringtones_advanced

Packages that implement flutter_system_ringtones_advanced