Convert CSS Gradients to Flutter Syntax

p
pete
Converting a CSS gradient to Flutter doesn’t have to be a headache. This function accepts your CSS linear-gradient string and outputs a Flutter LinearGradient. It sorts out angle conversion, multiple stops, and a range of color formats—whether you’re using hex or RGB—and even manages percentage positions if you leave any out.