setEnabled method

void setEnabled(
  1. bool enabled
)

Makes sure that AppLock shows the lockScreen (or preferably the Widget returned from lockScreenBuilder) on subsequent app pauses if enabled is true of makes sure it isn't shown on subsequent app pauses if enabled is false.

This is a convenience method for calling the enable or disable method based on enabled.

Implementation

void setEnabled(bool enabled) {
  if (enabled) {
    enable();
  } else {
    disable();
  }
}