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

A Flutter package that provides general-purpose services, tools, and features for Flutter applications.

Pluggy #

pub package License: MIT

A Flutter package that provides general-purpose services, tools, and features for Flutter applications.

🚀 Features #

  • Alert Service: Show SnackBar and BottomSheet from anywhere in the app
  • Context-independent: Works without depending on Navigator context
  • Easy to use: Simple and user-friendly API
  • Flutter 3.5.4+: Compatible with the latest Flutter versions

📦 Installation #

Add the following dependency to your pubspec.yaml file:

dependencies:
  pluggy: ^0.0.2

Then install the package:

flutter pub get

🔧 Usage #

Alert Service Setup #

Configure AlertServiceConfig in your main app:

import 'package:pluggy/services/alert_service/alert_service_config.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: AlertServiceConfig().navigatorKey, // Add this line
      home: MyHomePage(),
    );
  }
}

Show SnackBar #

import 'package:pluggy/services/alert_service/alert_service.dart';

// You can show SnackBar from anywhere
AlertService.showSnackBar("This is a test message!");

Show BottomSheet #

import 'package:pluggy/services/alert_service/alert_service.dart';

// You can show BottomSheet from anywhere
AlertService.showBottomSheet("Title", "This is a test message!");

📱 Example #

import 'package:flutter/material.dart';
import 'package:pluggy/services/alert_service/alert_service.dart';
import 'package:pluggy/services/alert_service/alert_service_config.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: AlertServiceConfig().navigatorKey,
      title: 'Pluggy Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Pluggy Demo')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () => AlertService.showSnackBar("SnackBar shown!"),
              child: Text('Show SnackBar'),
            ),
            SizedBox(height: 16),
            ElevatedButton(
              onPressed: () => AlertService.showBottomSheet(
                "Info",
                "This is a test BottomSheet."
              ),
              child: Text('Show BottomSheet'),
            ),
          ],
        ),
      ),
    );
  }
}

🛠️ Requirements #

  • Flutter: >=1.17.0
  • Dart SDK: ^3.5.4

📄 License #

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

🤝 Contributing #

We welcome your contributions! Please:

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📞 Contact #

📈 Version History #

0.0.2 #

  • Added Alert Service
  • SnackBar and BottomSheet support
  • Context-independent operation

0.0.1 #

  • Initial release
  • Basic structure
0
likes
0
points
68
downloads

Publisher

verified publisheralikara.dev

Weekly Downloads

A Flutter package that provides general-purpose services, tools, and features for Flutter applications.

Homepage
Repository (GitHub)
View/report issues

Topics

#flutter #services #alerts #snackbar #bottomsheet

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on pluggy