FloatyStateChannel<S> constructor

FloatyStateChannel<S>({
  1. required Map<String, dynamic> toJson(
    1. S state
    ),
  2. required S fromJson(
    1. Map<String, dynamic> json
    ),
  3. required S initialState,
})

Creates a state channel for the main app side.

Implementation

FloatyStateChannel({
  required Map<String, dynamic> Function(S state) toJson,
  required S Function(Map<String, dynamic> json) fromJson,
  required S initialState,
})  : _toJson = toJson,
      _fromJson = fromJson,
      _state = initialState {
  _init();
}