nextFlashMode static method

UFlashMode nextFlashMode(
  1. UFlashMode current, {
  2. bool includeTorch = true,
})

Implementation

static UFlashMode nextFlashMode(UFlashMode current, {bool includeTorch = true}) {
  final List<UFlashMode> order = includeTorch
      ? const <UFlashMode>[UFlashMode.off, UFlashMode.auto, UFlashMode.on, UFlashMode.torch]
      : const <UFlashMode>[UFlashMode.off, UFlashMode.auto, UFlashMode.on];
  return order[(order.indexOf(current) + 1) % order.length];
}