INNER CODE UNIT · Dart

nextIndex

BirjuVachhani/adaptive_theme · packages/adaptive_theme/lib/src/adaptive_theme_mode.dart:33

    final int nextIndex = (index + 1) % AdaptiveThemeMode.values.length;
    return AdaptiveThemeMode.values[nextIndex];
  }

  /// Loops through the mode values in a cyclic manner and returns the previous
  /// mode in the sequence.
  AdaptiveThemeMode previous() {
    final int previousIndex = (index - 1) % AdaptiveThemeMode.values.length;
    return AdaptiveThemeMode.values[previousIndex];
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…