wrapping Scaffold with Container for gradient background, How to set gradient to container background in flutter?

I’d like to wrap a Scaffold with a Container in order to get a gradient background that’s also underneath the AppBar. Basically a full screen gradient background. However, my attempt doesn’t do anything. Is there another way of doing it, where I can keep the AppBar functionality but have it on top of a gradient … Read more

CSS gradient checkerboard pattern

I want to create a checkerboard pattern using gradients. I’ve found an example and modified it to my needs, however it only works with -moz prefix. When I remove the -moz prefix, the pattern is completely different. How can I make this -moz checkerboard pattern work with unprefixed linear-gradient? body { background-image: linear-gradient(45deg, #808080 25%, … Read more

How to make transparent gradient?

I have the following gradient: <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android”> <gradient android:startColor=”#ECECEC” android:centerColor=”#F6F6F4″ android:endColor=”#F8F8F6″ android:angle=”90″ android:dither=”true” /> </shape> I want this to be transparent because in my ListView I am setting this as my ListSelector: <ListView android:layout_width=”fill_parent” android:layout_height=”fill_parent” xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/ARListView” android:background=”@drawable/transparent_background” android:cacheColorHint=”#00000000″ android:drawSelectorOnTop=”true” android:listSelector=”@drawable/stocks_selected_gradient”> </ListView> Answer Just use an 8-digit color value, e.g. #FFF8F8F6, where … Read more

angle attribute in android gradient

I am going through test example. Where for some Image background they are using gradient, the code goes like this <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android”> <gradient android:startColor=”#ff0000″ android:centerColor=”#00ff00″ android:endColor=”#0000ff” android:angle=”180″/> <corners android:radius=”5dp” /> </shape> In the above xml I didn’t get angle attribute. but when I change the value of angle slightly the pattern slants. … Read more

Android: Using linear gradient as background looks banded

I’m trying to apply a linear gradient to my ListView. This is the content of my drawable xml: <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android”> <gradient android:startColor=”#3A3C39″ android:endColor=”#181818″ android:angle=”270″ /> <corners android:radius=”0dp” /> </shape> So I apply it to my ListView with: android:background=”@drawable/shape_background_grey” It works but it looks very “banded” on emulator and on a real device … Read more

How do I programmatically set the background color gradient on a Custom Title Bar?

There are many tutorials out there and questions on SO that implement custom title bars. However, in my custom title bar I have a custom gradient for the background and I would like to know how to set it dynamically in my code. Here is where my custom title bar gets called: requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.foo_layout); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, … Read more