worker_manager 2.6.8 copy "worker_manager: ^2.6.8" to clipboard
worker_manager: ^2.6.8 copied to clipboard

outdated

Executor allows you to create a queue of tasks for isolate pool

example/lib/main.dart

// Copyright Daniil Surnin. All rights reserved.
// Use of this source code is governed by a Apache license that can be
// found in the LICENSE file.

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:worker_manager/worker_manager.dart';

void main() async {
  final c = Completer<int>();
  final t1 = Cancelable(c, () {});
  t1.cancel();
  await Future.delayed(Duration(seconds: 2));
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      showPerformanceOverlay: true,
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final results = [];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            RaisedButton(
                child: Text('fib(40) compute isolate'),
                onPressed: () {
                  final test = Test.kek;
                  print(test == Test.kek);
                }),
          ],
        ),
      ),
    );
  }
}

enum Test { kek, pek }
298
likes
0
pub points
94%
popularity

Publisher

verified publisherrenesanse.net

Executor allows you to create a queue of tasks for isolate pool

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

async

More

Packages that depend on worker_manager