pluggy 0.0.3
pluggy: ^0.0.3 copied to clipboard
A Flutter package that provides general-purpose services, tools, and features for Flutter applications.
Pluggy #
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:
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📞 Contact #
- Developer: Ali Kara
- Website: alikara.dev
- GitHub: @alikara
📈 Version History #
0.0.2 #
- Added Alert Service
- SnackBar and BottomSheet support
- Context-independent operation
0.0.1 #
- Initial release
- Basic structure