{"id":24044618,"url":"https://github.com/dev-cetera/df_plugins","last_synced_at":"2026-05-01T21:03:02.680Z","repository":{"id":262355872,"uuid":"886984625","full_name":"dev-cetera/df_plugins","owner":"dev-cetera","description":"Provides methods to create plugins for Dart and Flutter. This package demonstrates ways to make Dart and Flutter even more modular.","archived":false,"fork":false,"pushed_at":"2025-07-12T23:12:34.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-08T06:03:22.835Z","etag":null,"topics":["dart","flutter","library","modular","package","plugin"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/df_plugins","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dev-cetera.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["robmllze","dev-cetera"],"patreon":"RobertMollentze"}},"created_at":"2024-11-12T00:57:44.000Z","updated_at":"2025-07-12T23:12:38.000Z","dependencies_parsed_at":"2025-01-01T05:19:17.068Z","dependency_job_id":"e7f4447a-b933-434a-8805-26f29519893b","html_url":"https://github.com/dev-cetera/df_plugins","commit_stats":null,"previous_names":["devcetra/df_plugins","dev-cetera/df_plugins","robmllze/df_plugins"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dev-cetera/df_plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-cetera%2Fdf_plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-cetera%2Fdf_plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-cetera%2Fdf_plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-cetera%2Fdf_plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-cetera","download_url":"https://codeload.github.com/dev-cetera/df_plugins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-cetera%2Fdf_plugins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32512670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","library","modular","package","plugin"],"created_at":"2025-01-08T23:32:30.089Z","updated_at":"2026-05-01T21:03:02.655Z","avatar_url":"https://github.com/dev-cetera.png","language":"Dart","funding_links":["https://github.com/sponsors/robmllze","https://github.com/sponsors/dev-cetera","https://patreon.com/RobertMollentze","https://www.buymeacoffee.com/dev_cetera","https://www.patreon.com/c/RobertMollentze"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.buymeacoffee.com/dev_cetera\" target=\"_blank\"\u003e\u003cimg align=\"right\" src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" height=\"48\"\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/gEQ8y2nfyX\" target=\"_blank\"\u003e\u003cimg align=\"right\" src=\"https://raw.githubusercontent.com/dev-cetera/.github/refs/heads/main/assets/icons/discord_icon/discord_icon.svg\" height=\"48\"\u003e\u003c/a\u003e\n\nDart \u0026 Flutter Packages by dev-cetera.com \u0026 contributors.\n\n[![sponsor](https://img.shields.io/badge/sponsor-grey?logo=github-sponsors)](https://github.com/sponsors/dev-cetera)\n[![patreon](https://img.shields.io/badge/patreon-grey?logo=patreon)](https://www.patreon.com/c/RobertMollentze)\n[![pub](https://img.shields.io/pub/v/df_plugins.svg)](https://pub.dev/packages/df_plugins)\n[![tag](https://img.shields.io/badge/tag-v0.2.2-purple?logo=github)](https://github.com/dev-cetera/df_plugins/tree/v0.2.2)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/dev-cetera/df_plugins/main/LICENSE)\n\n---\n\n[![banner](https://github.com/dev-cetera/df_safer_dart/blob/v0.2.2/doc/assets/banner.png?raw=true)](https://github.com/dev-cetera)\n\n\u003c!-- BEGIN _README_CONTENT --\u003e\n\n## Summary\n\nProvides methods to create plugins for Dart and Flutter. This package demonstrates ways to make Dart and Flutter even more modular.\n\n## Example\n\n```dart\nimport 'package:df_plugins/df_plugins.dart'; // for Flutter projects\n\n// ignore_for_file: unnecessary_import\nimport 'package:df_plugins/df_plugins_dart.dart'; // for Dart-only projects\n\nimport 'package:flutter/material.dart';\n\n// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░\n\nvoid main() {\n  dartExample();\n  flutterExample();\n}\n\n// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░\n//\n// Dart Plugins Example.\n//\n// This is an example of using Functional plugins to transform data in\n// your app.\n//\n// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░\n\nvoid dartExample() {\n  // Dart Plugins Example:\n  final math = FunctionalPluginManager\u003cnum\u003e();\n  math.registerAll([\n    const ValuePlugin(10),\n    const AddPlugin(5),\n    const MultiplyPlugin(2),\n    const SubtractPlugin(3),\n  ]);\n  math.register(const AddPlugin(5));\n  math.register(const MultiplyPlugin(2));\n  math.register(const SubtractPlugin(3));\n  final result = math.build();\n  debugPrint('Total: $result'); // prints 27\n}\n// Define some plugins that manipulate numbers. These examples are simple, but\n// you can imagine more complex plugins that perform more complex operations,\n// such as matrix multiplication, image processing, or even machine learning.\n\nfinal class ValuePlugin\u003cT extends num\u003e extends FunctionalPlugin\u003cT\u003e {\n  final T value;\n  const ValuePlugin(this.value);\n\n  @override\n  T execute(List\u003cT\u003e previousOutputs) {\n    if (previousOutputs.isNotEmpty) {\n      throw Exception('ValuePlugin must be the first plugin in the list.');\n    }\n    return value;\n  }\n}\n\nfinal class AddPlugin\u003cT extends num\u003e extends FunctionalPlugin\u003cT\u003e {\n  final T value;\n  const AddPlugin(this.value);\n\n  @override\n  T execute(List\u003cT\u003e previousOutputs) {\n    return previousOutputs.last + value as T;\n  }\n}\n\nfinal class MultiplyPlugin\u003cT extends num\u003e extends FunctionalPlugin\u003cT\u003e {\n  final T value;\n  const MultiplyPlugin(this.value);\n\n  @override\n  T execute(List\u003cT\u003e previousOutputs) {\n    return previousOutputs.last * value as T;\n  }\n}\n\nfinal class SubtractPlugin\u003cT extends num\u003e extends FunctionalPlugin\u003cT\u003e {\n  final T value;\n  const SubtractPlugin(this.value);\n\n  @override\n  T execute(List\u003cT\u003e previousOutputs) {\n    return previousOutputs.last - value as T;\n  }\n}\n\n// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░\n//\n// Flutter Plugins Example.\n//\n// This is an example of using Widget plugins to add widgets to your app.\n// Widget plugins could add modularity to your apps if properly implemented.\n//\n// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░\n\nvoid flutterExample() {\n  runApp(const PluginApp());\n}\n\nclass PluginApp extends StatelessWidget {\n  const PluginApp({super.key});\n\n  @override\n  Widget build(BuildContext context) {\n    return const MaterialApp(\n      home: Scaffold(\n        // Also try:\n        // - WidgetColumnPluginBuilder to draw plugins in a Column\n        // - WidgetRowPluginBuilder to draw plugins in a Row\n        // - WidgetWrapPluginBuilder to draw plugins in a Wrap\n        // - WidgetStackPluginBuilder to draw plugins in a Stack\n        // - WidgetTreePluginBuilder to draw plugins in a tree hierarchy.\n        // - Extend WidgetPluginBuilder to define your own builder.\n        body: WidgetTreePluginBuilder(\n          plugins: [\n            // Apply plugins in order, each Treeing the previous result.\n            WidgetPlugin(child: Text('Hello Plugins!!!')),\n            PaddingPlugin(padding: EdgeInsets.all(8.0)),\n            BackgroundColorPlugin(color: Colors.yellow),\n            PaddingPlugin(padding: EdgeInsets.all(20.0)),\n            BackgroundColorPlugin(color: Colors.blue),\n          ],\n          child: SizedBox(),\n        ),\n      ),\n    );\n  }\n}\n\n/// A simple plugin that returns its child.\nclass WidgetPlugin extends AttachableWidgetPlugin {\n  final Widget child;\n  const WidgetPlugin({required this.child});\n\n  @override\n  Widget attach(BuildContext context, Widget child) {\n    return child;\n  }\n}\n\n/// A simple plugin that sets the background color of the widget.\nclass BackgroundColorPlugin extends AttachableWidgetPlugin {\n  final Color color;\n  const BackgroundColorPlugin({required this.color});\n\n  @override\n  Widget attach(BuildContext context, Widget child) {\n    return Container(\n      color: color,\n      child: child,\n    );\n  }\n}\n\n/// A simple plugin that adds padding around the widget.\nclass PaddingPlugin extends AttachableWidgetPlugin {\n  final EdgeInsets padding;\n  const PaddingPlugin({required this.padding});\n\n  @override\n  Widget attach(BuildContext context, Widget child) {\n    return Padding(\n      padding: padding,\n      child: child,\n    );\n  }\n}\n```\n\n\u003c!-- END _README_CONTENT --\u003e\n\n---\n\n☝️ Please refer to the [API reference](https://pub.dev/documentation/df_plugins/) for more information.\n\n---\n\n## 💬 Contributing and Discussions\n\nThis is an open-source project, and we warmly welcome contributions from everyone, regardless of experience level. Whether you're a seasoned developer or just starting out, contributing to this project is a fantastic way to learn, share your knowledge, and make a meaningful impact on the community.\n\n### ☝️ Ways you can contribute\n\n- **Buy me a coffee:** If you'd like to support the project financially, consider [buying me a coffee](https://www.buymeacoffee.com/dev_cetera). Your support helps cover the costs of development and keeps the project growing.\n- **Find us on Discord:** Feel free to ask questions and engage with the community here: https://discord.gg/gEQ8y2nfyX.\n- **Share your ideas:** Every perspective matters, and your ideas can spark innovation.\n- **Help others:** Engage with other users by offering advice, solutions, or troubleshooting assistance.\n- **Report bugs:** Help us identify and fix issues to make the project more robust.\n- **Suggest improvements or new features:** Your ideas can help shape the future of the project.\n- **Help clarify documentation:** Good documentation is key to accessibility. You can make it easier for others to get started by improving or expanding our documentation.\n- **Write articles:** Share your knowledge by writing tutorials, guides, or blog posts about your experiences with the project. It's a great way to contribute and help others learn.\n\nNo matter how you choose to contribute, your involvement is greatly appreciated and valued!\n\n### ☕ We drink a lot of coffee...\n\nIf you're enjoying this package and find it valuable, consider showing your appreciation with a small donation. Every bit helps in supporting future development. You can donate here: https://www.buymeacoffee.com/dev_cetera\n\n\u003ca href=\"https://www.buymeacoffee.com/dev_cetera\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" height=\"40\"\u003e\u003c/a\u003e\n\n## 🧑‍⚖️ License\n\nThis project is released under the [MIT License](https://raw.githubusercontent.com/dev-cetera/df_plugins/main/LICENSE). See [LICENSE](https://raw.githubusercontent.com/dev-cetera/df_plugins/main/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-cetera%2Fdf_plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-cetera%2Fdf_plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-cetera%2Fdf_plugins/lists"}