refreshWidget method

  1. @internal
void refreshWidget({
  1. bool isInternalRefresh = true,
})
inherited

When a Game is attached to a GameWidget, this method will force that widget to be rebuilt. This can be used when updating any property which is implemented within the Flutter tree.

When isInternalRefresh is passed as false it will trigger the onAttach and onDetach events; otherwise, those events will not be called.

Implementation

@internal
void refreshWidget({bool isInternalRefresh = true}) {
  _isInternalRefresh = isInternalRefresh;
  gameStateListeners.forEach((callback) => callback());
}