basic_beep 1.0.3 copy "basic_beep: ^1.0.3" to clipboard
basic_beep: ^1.0.3 copied to clipboard

A lite module to play system sounds and beep for flutter mobile and web

example/lib/main.dart

import 'package:basic_beep/basic_beep.dart';
import 'package:basic_beep/data/models/android_sound_ids.dart';
import 'package:basic_beep/data/models/ios_sound_ids.dart';
import 'package:flutter/material.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
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Plugin example app')),
        body: Center(
          child: Column(
            children: <Widget>[
              ElevatedButton(
                child: Text("Beep Success"),
                onPressed: () => BasicBeep.beep(),
              ),
              SizedBox(height: 8),
              ElevatedButton(
                child: Text("Beep Fail"),
                onPressed: () => BasicBeep.beep(false),
              ),
              SizedBox(height: 8),
              ElevatedButton(
                child: Text("Beep Android Custom"),
                onPressed: () => BasicBeep.playSysSound(
                  AndroidSoundIDs.TONE_CDMA_ABBR_ALERT,
                ),
              ),
              SizedBox(height: 8),
              ElevatedButton(
                child: Text("Beep something"),
                onPressed: () => BasicBeep.playSysSound(41),
              ),
              SizedBox(height: 8),
              ElevatedButton(
                child: Text("Beep iOS Custom"),
                onPressed: () =>
                    BasicBeep.playSysSound(IosSoundIDs.AudioToneBusy),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
140
points
421
downloads

Publisher

unverified uploader

Weekly Downloads

A lite module to play system sounds and beep for flutter mobile and web

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, web

More

Packages that depend on basic_beep

Packages that implement basic_beep