service_bloc 0.0.1+1 copy "service_bloc: ^0.0.1+1" to clipboard
service_bloc: ^0.0.1+1 copied to clipboard

outdated

Flutter package for service layer implement with bloc architecture

example/lib/example.dart

import 'package:example/github/bloc/service_bloc.dart';
import 'package:example/github/modal/modal.dart';
import 'package:service_bloc/service_bloc.dart';

void main() async {
  final organizationDetailServiceBloc = GithubOrganisationDetailServiceBloc();
  organizationDetailServiceBloc
      .add(GithubOrganisationDetailServiceRequested(name: 'flutter'));
  await for (final state in organizationDetailServiceBloc.stream) {
    if (state is! ServiceResponseState) continue;

    if (state is ServiceLoadSuccess<GithubOrganisationDetailServiceRequested,
        GithubOrganizationDetail>) {
      print('response: ${state.data}');
    }

    if (state is ServiceLoadFailure) {
      print('error: ${state.error}');
    }

    break;
  }
}
0
likes
0
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter package for service layer implement with bloc architecture

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

bloc, bloc_concurrency, equatable, meta

More

Packages that depend on service_bloc