codenic_bloc_use_case 0.1.0 copy "codenic_bloc_use_case: ^0.1.0" to clipboard
codenic_bloc_use_case: ^0.1.0 copied to clipboard

outdated

A suite of abstract cubits to reduce boilerplate code and construct app use cases.

example/main.dart

// ignore_for_file: avoid_print

import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:codenic_bloc_use_case/codenic_bloc_use_case.dart';

import 'src/failure.dart';
import 'src/simple_bloc_observer.dart';

part 'batch_runner_sample.dart';
part 'paginator_sample.dart';
part 'runner_sample.dart';
part 'watcher_sample.dart';

/// To view the entire code example, see
/// https://github.com/CodenicCoders/codenic_bloc_use_case/tree/master/example

Future<void> main() async {
  print(
    'Enter [0] for Runner, '
    '[1] for Watcher, '
    '[2] for Paginator, '
    '[3] for Batch Runner: ',
  );

  final input = stdin.readLineSync(encoding: utf8);

  await BlocOverrides.runZoned(
    () async {
      switch (input) {
        case '0':
          await runner();
          break;
        case '1':
          await watcher();
          break;
        case '2':
          await paginator();
          break;
        case '3':
          await batchRunner();
          break;
      }
    },
    blocObserver: SimpleBlocObserver(),
  );
}
5
likes
0
pub points
18%
popularity

Publisher

verified publishercodenic.dev

A suite of abstract cubits to reduce boilerplate code and construct app use cases.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

bloc, dartz, equatable, meta

More

Packages that depend on codenic_bloc_use_case