beep_sound 0.0.3 copy "beep_sound: ^0.0.3" to clipboard
beep_sound: ^0.0.3 copied to clipboard

A very lite module to play system sounds and beep for flutter apps (no sound files)

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';

import 'package:beep_sound/beep_sound.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) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Plugin example app')),

        body:
            Platform.isIOS
                ? ListView.builder(
                  itemCount: IOSSoundID.values.length,
                  itemBuilder: (c, i) {
                    var item = IOSSoundID.values[i];
                    return ListTile(
                      title: Text(item.name),
                      onTap: () {
                        BeepSound().playSysSound(item.value);
                      },
                    );
                  },
                )
                : ListView.builder(
                  itemCount: AndroidSoundIDs.values.length,
                  itemBuilder: (c, i) {
                    var item = AndroidSoundIDs.values[i];
                    return ListTile(
                      title: Text(item.name),
                      onTap: () {
                        BeepSound().playSysSound(item.value);
                      },
                    );
                  },
                ),
      ),
    );
  }
}
1
likes
160
points
83
downloads

Publisher

verified publisheremintolgahanpolat.com

Weekly Downloads

A very lite module to play system sounds and beep for flutter apps (no sound files)

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on beep_sound