onStart method

  1. @protected
void onStart()

Called when the widget becomes visible to the user. This is where you should:

  • Load initial data
  • Initialize UI components
  • Set up event listeners
  • Register broadcast receivers
  • Start location updates

Example:

@override
void onStart() {
  super.onStart();
  _loadInitialData();
  _setupEventListeners();
  _locationService.startUpdates();
  SystemChannels.lifecycle.setMessageHandler(_handleLifecycleMessage);
}

Implementation

@protected
void onStart() {}