Skip to content

Instantly share code, notes, and snippets.

@alphamikle
Created January 31, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphamikle/82f39159c00f147ed68a17f482f10ef5 to your computer and use it in GitHub Desktop.
Save alphamikle/82f39159c00f147ed68a17f482f10ef5 to your computer and use it in GitHub Desktop.
Tasks and operations
/// Frontend part
/// This block is responsible for handling events from the isolate.
@override
Map<Events, Function> get tasks => {
Events.increment: _setCounter,
Events.decrement: _setCounter,
Events.error: _setCounter,
};
/// -----
/// Backend part
/// And this one is for handling events from the main thread
@override
Map<Events, Function> get operations => {
Events.increment: _increment,
Events.decrement: _decrement,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment