In the site material.io it is written that:
To create branded dark surfaces, overlay the primary brand color at a low opacity over the recommended dark theme surface color (#121212). The color #1F1B24 is the result of combining the dark theme surface color #121212 and the 8% Primary color.
My questions are:
A solution for the overlay without using widgets is to use Color.alphaBlend which
combine[s] the foreground color as a transparent color over top of a background color, and return[s] the resulting combined color.
You use it like this:
Color newColor = Color.alphaBlend(foregroundColor, backgroundColor);
1.8% of a color is the color but with 8% Opacity. This can be achieved by using the Opacity widget or by using the withOpacity method of the Colors class.
2.
An overlay is a semi-transparent covering on an element, indicating state. Overlays provide a systematic approach to visualizing states using opacity.
To give an Overlay in Flutter use the Overlay Widget.
example in flutter-using-overlay-to-display-floating-widgets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With