Reputation: 15525
I have a requirement to create gradient bg like
with css code
.rectangle {
height: 864px;
width: 384px;
border-radius: 10px;
background: linear-gradient(220.25deg, #2BB88B 0%, #07909B 35.17%, #035762 100%);
}
I tried with
LinearGradient(
begin: Alignment.topRight,
colors: const <Color>[
Color(0xFF2BB88B),
Color(0xFF07909B),
Color(0xFF035762)
],
/*stops: [
0,
0.35,
0.1
]*/)
but it doesn't work as expected. Also I have tried with SweepGradient, which also not worked.
Upvotes: 2
Views: 1046
Reputation: 6029
Did you try giving it the 'end' property?
end : Alignment.bottomRight or end : Alignment.bottomLeft,
LinearGradient(
begin: Alignment.topRight,
end : Alignment.bottomRight,
colors: const <Color>[
Color(0xFF2BB88B),
Color(0xFF07909B),
Color(0xFF035762)
],
/*stops: [
0,
0.35,
0.1
]*/)
Upvotes: 2