onInit method

  1. @override
void onInit()
override

Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.

Implementation

@override
void onInit() {
  super.onInit();
  // Auto-navigate to detail if only one task
  final items = allSelectableItems;
  if (items.length == 1) {
    _skippedListOnMount = true;
    viewMode.value = 'detail';
    detailTaskId.value = items.first.id;
  }
}