AnimatedGradient({Key? key, required this.colors, this.child}) : super(key: key){ if(colors.length < 2){ throw Exception("length needs to be at least 2"); } }