Skip to content

Flutter-based compute operation that can be canceled with either null or a specific value.

License

Notifications You must be signed in to change notification settings

ykmnkmi/cancelable-compute.dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pub package

cancelable-compute.dart

Flutter-based compute operation that can be canceled with either null or a specific value.

Usage

A simple usage example:

import 'package:cancelable_compute/cancelable_compute.dart';

Future<void> main() async {
  var operation = compute(fib, 256);

  void onTap() {
    operation.cancel(-1);
  }

  final result = await operation.value;
  print(result);
}

Note for Web

Canceling doesn't stop the running future.

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

MIT

About

Flutter-based compute operation that can be canceled with either null or a specific value.

Topics

Resources

License

Stars

Watchers

Forks

Languages