Faaah ðŸ˜ą

A hilarious and iconic Flutter package that plays the legendary "FAAAAH" meme sound whenever an error occurs in your application. Perfect for developers who want to add a bit of chaotic fun to their debugging and error-handling process.


âœĻ Features

  • 👂 Audible Debugging: Know your app crashed even if you aren't looking at the logs.
  • ðŸ›Ąïļ Global Error Support: Automatically trigger the sound on every Flutter framework error with one line of code.
  • ⚡ Manual Playback: Programmatically trigger the sound in your own try-catch blocks.
  • ðŸ“Ķ Package-Friendly: Correctly handles asset paths so it works as a dependency in any project.
  • ðŸŠķ Lightweight: Minimal impact on app size and performance.

🚀 Installation

Add faaah to your pubspec.yaml:

dependencies:
  faaah: ^0.0.1

Then, run:

flutter pub get

🛠ïļ How to Use

Call Faaah.enableGlobalErrorSound() in your main() before runApp. This will hook into the Flutter framework's error handler.

import 'package:flutter/material.dart';
import 'package:faaah/faaah.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized(); // ⚠ïļ Must initialize Flutter engine first
  Faaah.enableGlobalErrorSound(); // 😈 Hear the "FAAAAH" on every UI or framework error!
  
  runApp(const MyApp());
}

2. Manual Trigger

Use this inside your custom error handlers or as a fun interaction.

import 'package:faaah/faaah.dart';

void riskyOperation() {
  try {
    // Some code that might fail...
  } catch (e) {
   Future.microtask(() async => await Faaah.play()); // ⚠ïļ Must await the Future
    print("Handled error: $e");
  }
}

ðŸŽŪ Watch it in Action

Check out the Example App which features a Calculator that screams "FAAAAH" when you divide by zero!


📖 Important Note on Assets

Since this is a package, the assets are managed internally. You do not need to add the .mp3 file to your own pubspec.yaml. Just import the package and it works out of the box!


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Created by Muhammad Rehan Yousaf

Libraries

faaah