Make a global Flutter Gradient for all backgrounds in App

Viewed 187

To achieve this in the earlier stages of the app I am developing, I made a file "theme.dart" that has a bunch of global color variables that I have been using to theme my project.

Here is an example:

Color backgroundColor = Colors.grey.shade100

I currently trying to make a gradient variable that works the same way, that only lives in this file to be called throughout the project.

Gradient gradientTry = new LinearGradient(color:[color here], color:[color here])

I have found some resources that make it pretty clear how to create a gradient for a specific widget, but I want to find a workaround to keep it consistent with how I have been handling the styles. There hasn't been any useful results in my research so far as well as on the flutter documentation, so any help or idea would be greatly appreciated.

0 Answers
Related