Skip to content

[Impeller] gradients are not working as expected #111534

@ColdPaleLight

Description

@ColdPaleLight

Gradients are not working as expected on master channel.

code

import 'package:flutter/material.dart';

void main() {
  runApp(CustomPaint(painter: Painter()));
}

class Painter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    final Paint paint = Paint();
    paint.shader = const LinearGradient(
      colors: <Color>[Color(0xFF00FF00), Color(0xFF0000FF)],
      tileMode: TileMode.repeated
    ).createShader(const Rect.fromLTRB(0, 0, 300, 300), textDirection: TextDirection.ltr);
    canvas.drawRect(Rect.fromLTWH(0, 0, 300, 300), paint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}

expected result

Screenshot_2022-09-14-14-08-36-497_com yourcompany complexLayout

actual result

Screenshot_2022-09-14-14-37-09-975_com yourcompany complexLayout

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions