command 0.0.6 copy "command: ^0.0.6" to clipboard
command: ^0.0.6 copied to clipboard

Provides a simple Command pattern class with execute and undo capabilities

command #

The Command package provides a Command class to enable generic execute/undo Command Pattern capabilities. The actual actions to be performed are implemented in any custom class that extends the CommandAction interface.

How do I get set up? #

To add the published version of this package to your project, create a dependency for command in your pubspec.yaml file:

dependencies:
  command: ^0.0.6

The most recent development version is available on BitBucket. You can access it with the following git dependency:

dependencies:
  command:
    git:
      url: https://bitbucket.org/porcupinesupernova/dart_packages.git
      path: command

A simple usage example:

import 'package:command\command.dart';

class CustomCommandAction extends CommandAction{
  String get key => "CustomAction";
  action(){
    //Custom action code here
  }

  undoAction(){
    //Code to undo the action
  }
}

main(){
  var command = new Command(
    new CustomCommandAction(),
  );

  command.execute();
  command.undo();
}

Submitting issues #

Submit issues in the issue tracker

0
likes
20
pub points
19%
popularity

Publisher

unverified uploader

Provides a simple Command pattern class with execute and undo capabilities

Homepage

License

BSD-2-Clause (LICENSE)

More

Packages that depend on command