EmpireState<T extends EmpireWidget<EmpireViewModel>, E extends EmpireViewModel> constructor Null safety

EmpireState<T extends EmpireWidget<EmpireViewModel>, E extends EmpireViewModel>(
  1. E viewModel
)

Implementation

EmpireState(this.viewModel) {
  viewModel.addOnStateChangedListener((events) {
    if (widget.debugPrintStateChanges && kDebugMode) {
      // ignore: avoid_print
      events.forEach(print);
    }
    if (mounted) {
      setState(() {});
    }
  });
}