3

enter image description here

I want to half color the container green like this

What is the best way to go about this?

1 Answer 1

3

There are many ways of doing,You can use LinearGradient .

Container(
  height: 200,
  width: 200,
  decoration: BoxDecoration(
    gradient: LinearGradient(
      stops: [.5, .5],
      begin: Alignment.bottomLeft,
      end: Alignment.topRight,
      colors: [
        Colors.green,
        Colors.transparent, // top Right part
      ],
    ),
  ),
),

enter image description here

Decorate the way you want. More about Container

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.