flutter_sound_button 0.1.1 copy "flutter_sound_button: ^0.1.1" to clipboard
flutter_sound_button: ^0.1.1 copied to clipboard

A customizable Flutter button widget that plays sound effects on press.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_sound_button/flutter_sound_button.dart';
import 'package:flutter_sound_button/default_sounds.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Flutter Sound Button Example')),
        body: Center(
          // Create a SoundButton with a default sound and an onPressed callback.
          child: SoundButton(
            defaultSound: DefaultSound.click, // Use the default click sound.
            child: const Text('Click Me'), // Display a text widget inside the button.
            onPressed: () => print('Button clicked!'), // Print a message when the button is pressed.
          ),
        ),
      ),
    );
  }
}
1
likes
145
points
94
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A customizable Flutter button widget that plays sound effects on press.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, just_audio

More

Packages that depend on flutter_sound_button