EventBusWidget constructor

EventBusWidget(
  1. {Key key,
  2. @required Widget child,
  3. bool sync: false}
)

Default constructor that create a default EventBus and provided it to child widget and its children. A key can be provided if necessary And sync can be used to control whether EventBus is synchronized or asynchronized, default to asynchronized.

Implementation

EventBusWidget({Key key, @required Widget child, bool sync = false})
    : eventBus = EventBus(sync: sync),
      super(key: key, child: child);