AnimatedGlitchController constructor
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,
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();
}