Based on online videos this code should show 'gradients' property but it just shows the 'lerp' method. I am currently running Dart v2.9.1 and Flutter v1.20.2.

enter image description here

Thank You in advance


Solution 1: Abion47

You can't add a static member to the original class. Extensions add instance methods to the class, and that's it. In this case, you would have to give your extension a name:

extension LinearGradientExt on LinearGradient { ...

and then access the static member with LinearGradientExt.gradients.