react_async 0.1.0

  • Installing
  • Versions
  • 56


pub package

Provides components for building asynchronous user interfaces out of dart-react.

This makes easy to adopt the BloC pattern and share a major part of your Flutter application logic with a website since the components are inspired by their Flutter equivalent.


The example below shows you how to use StreamBuilder and FutureBuilder.

import 'dart:async';
import 'dart:html';
import 'package:react_async/async.dart';
import 'package:react/react.dart';
import 'package:react/react_client.dart' as react_client;
import 'package:react/react_dom.dart' as react_dom;

/// An example model object that exposes a `Future` and a
/// `Stream`. Our components will be able to observe them,
/// and update in accordingly.
class Model {
  Future<String> future() async {
    await Future.delayed(Duration(seconds: 4));
    return "Finished!";

  Stream<String> stream() async* {
    await Future.delayed(Duration(seconds: 1));
    yield "3";
    await Future.delayed(Duration(seconds: 1));
    yield "2";
    await Future.delayed(Duration(seconds: 1));
    yield "1";
    await Future.delayed(Duration(seconds: 1));
    yield "Finished!";

/// An example component that will be updated asynchronously 
/// from our model.
class HomeComponent extends Component {
  final Model model = Model();

  /// A component instance that will be refreshed at the end
  /// of the model's future execution.
  dynamic _fromFuture() => FutureBuilder<String>(
    initialData: "Ready...",
    future: this.model.future(),
    builder: (s) => b({},;

  /// A component instance that will be refreshed on each update
  /// from the model's stream.
  dynamic _fromStream() => StreamBuilder<String>(
    initialData: "Ready...",
    builder: (s) => b({},;

  render() => div({}, [
    div({}, [ "Future:", _fromFuture()]),
    div({}, [ "Stream:", _fromStream()]),

var Home = registerComponent(() => HomeComponent());

main() {
  react_dom.render(Home({}), querySelector('#react_mount_point'));


Please file any issues, bugs, or feature requests on GitHub.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  react_async: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:react_async/async.dart';
import 'package:react_async/base/hash_codes.dart';
import 'package:react_async/base/renderers.dart';
import 'package:react_async/base/snapshot.dart';
import 'package:react_async/builders/future_builder.dart';
import 'package:react_async/builders/stream_builder.dart';
Version Uploaded Documentation Archive
0.1.0 Oct 22, 2018 Go to the documentation of react_async 0.1.0 Download react_async 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.10


Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Format lib/async.dart.

Run dartfmt to format lib/async.dart.

Format lib/base/hash_codes.dart.

Run dartfmt to format lib/base/hash_codes.dart.

Format lib/base/renderers.dart.

Run dartfmt to format lib/base/renderers.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/base/snapshot.dart (Run dartfmt to format lib/base/snapshot.dart.)
  • lib/builders/future_builder.dart (Run dartfmt to format lib/builders/future_builder.dart.)
  • lib/builders/stream_builder.dart (Run dartfmt to format lib/builders/stream_builder.dart.)

Maintenance issues and suggestions

Maintain (-20 points)

Changelog entries help clients to follow the progress in your code.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
meta ^1.1.6 1.1.7
react ^4.5.0 4.5.0
Transitive dependencies
js 0.6.1+1
Dev dependencies
build_runner >=0.8.10 <2.0.0
build_web_compilers >=0.3.6 <0.5.0