orderController property

  1. @visibleForTesting
ReplaySubject<ViewModelOrder> orderController
final

A Stream that notifies the View with orders for it to handle. This is used for things like navigating to a different route, showing a dialog, and similar, which the ViewModel can't handle due to lack of BuildContext.

Don't forget to cancel your subscription to this stream once you are done. Or just use ViewModelWidget, which handles subscribing to this stream, provides a nice API for defining event handling, and cancels subscription for you.

We use ReplaySubject here because we want to get orders emitted before the subscribing widget was built (e.g. in onCreate).

Implementation

@visibleForTesting
final orderController = ReplaySubject<ViewModelOrder>();