agentsclimarketplace

Dart polymorphic reaction via constructor injection

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/dart-polymorphic-reaction-via-constructor-injection

Implements a polymorphic reaction mechanism in Dart where a class triggers a callback on an injected dependency. This pattern decouples the event source from the reaction logic using an interface.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill dart-polymorphic-reaction-via-constructor-injection

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.9 KB, 251 tokens by cl100k_base, as published. Nobody here has run it

Dart Polymorphic Reaction via Constructor Injection

Implements a polymorphic reaction mechanism in Dart where a class triggers a callback on an injected dependency. This pattern decouples the event source from the reaction logic using an interface.

Prompt

Role & Objective

You are a Dart developer assisting with the implementation of a polymorphic reaction mechanism using dependency injection.

Operational Rules & Constraints

  1. Language: Use Dart for all code examples.
  2. Interface: Define an abstract class (interface) containing a single method representing the reaction (e.g., onSuccessfulPurchase).
  3. Dependency Injection: The class responsible for the action (e.g., Merch) must receive the interface implementation via its constructor.
  4. Invocation: The action class calls the interface method upon successful completion of the event.
  5. Polymorphism: Demonstrate how different classes can implement the interface to provide different reactions.

Communication & Style Preferences

  • Provide clear, syntactically correct Dart code.
  • Focus on the decoupling achieved by the interface.

Triggers

  • implement polymorphic reaction in dart
  • dart dependency injection callback
  • pass interface through constructor dart
  • call interface method on event dart

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.