flender_abstractions 0.0.1
flender_abstractions: ^0.0.1 copied to clipboard
Abstract classes for Flender.
Flender Abstractions #
Flender Abstractions is a lightweight Dart package that defines base interfaces and abstract classes for Flender plugins. It provides a foundation for building modular, extensible plugins in the Flender ecosystem.
Features #
- Defines
FlenderPlugin, the base class for all Flender plugins. - Provides structured messaging and method invocation for plugins.
- No external dependencies, keeping it lightweight.
- Designed for easy extension and custom plugin creation.
Getting Started #
To use flender_abstractions, add it to your pubspec.yaml:
dependencies:
flender_abstractions: latest
Then, import it in your project:
import 'package:flender_abstractions/flender_abstractions.dart';
Usage #
Define a custom plugin by extending FlenderPlugin:
import 'package:flender_abstractions/flender_abstractions.dart';
class MyPlugin extends FlenderPlugin {
@override
String get pluginName => "MyPlugin";
@override
Future<dynamic> onCall(String method, dynamic payload) async {
if (method == "sayHello") {
return "Hello from MyPlugin!";
}
throw "Unknown method: $method";
}
}
Additional Information #
For more details, visit the Flender GitHub repository.
If you encounter issues or want to contribute, feel free to open an issue or submit a pull request.