event_queue 0.1.6 copy "event_queue: ^0.1.6" to clipboard
event_queue: ^0.1.6 copied to clipboard

Event queues for queuing async tasks.

example/lib/main.dart

import 'package:event_queue_example/bodies/async.dart';
import 'package:event_queue_example/bodies/custom_priority.dart';
import 'package:event_queue_example/bodies/droppable.dart';
import 'package:event_queue_example/bodies/read_write.dart';
import 'package:event_queue_example/bodies/sequential.dart';
import 'package:event_queue_example/bodies/single_element.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MaterialApp(home: _Page()));
}

enum CaseStudy {
  sequential,
  droppable,
  singleElement,
  customPriority,
  async,
  readWrite,
}

class _Page extends StatelessWidget {
  const _Page();

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: CaseStudy.values.length,
      child: Scaffold(
        appBar: AppBar(
          title: const Text('Event queue example'),
          bottom: TabBar(
            tabs: CaseStudy.values.map((e) => Tab(text: e.name)).toList(),
          ),
        ),
        body: TabBarView(
          children: CaseStudy.values
              .map((e) => switch (e) {
                    CaseStudy.sequential => const SequentialBody(),
                    CaseStudy.droppable => const DroppableBody(),
                    CaseStudy.singleElement => const SingleElementBody(),
                    CaseStudy.customPriority => const CustomPriorityBody(),
                    CaseStudy.async => const AsyncBody(),
                    CaseStudy.readWrite => const ReadWriteBody(),
                  })
              .toList(),
        ),
      ),
    );
  }
}
3
likes
140
points
264
downloads

Publisher

verified publishermartinsellergren.dev

Weekly Downloads

Event queues for queuing async tasks.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection

More

Packages that depend on event_queue