AnimatedGlitchController constructor

AnimatedGlitchController({
  1. Duration frequency = const Duration(milliseconds: 1000),
  2. int chance = 50,
  3. double level = 1.0,
  4. ColorChannelShift colorChannelShift = const ColorChannelShift(),
  5. DistortionShift distortionShift = const DistortionShift(),
  6. bool autoStart = true,
})

Implementation

AnimatedGlitchController({
  Duration frequency = const Duration(milliseconds: 1000),
  int chance = 50,
  double level = 1.0,
  ColorChannelShift colorChannelShift = const ColorChannelShift(),
  DistortionShift distortionShift = const DistortionShift(),
  bool autoStart = true,
})  : assert(
        chance <= _maxChance,
        'Chance must not be higher than $_maxChance',
      ),
      assert(
        distortionShift.delay == colorChannelShift.delay,
        'To be able glitch synchronized, shiftings must have the same interval.',
      ),
      _chance = chance,
      _frequency = frequency,
      _level = level,
      _colorChannelShift = colorChannelShift,
      _distortionShift = distortionShift {
  if (autoStart) start();
}