Closed
Description
Since 1.10.17, if a Stack contains an image and colored Container or CustomPaint on top of it, drawn shapes are not visible.
master branch : Flutter (Channel master, v1.10.17-pre.74, on Mac OS X 10.14.6 18G1012, locale fr-FR)
On dev branch 1.10.16 : works as expected
On master branch and dev branch 1.12.1
On master branch with an image with half opacity
Steps to Reproduce
You can download and run the project
- add a Stack in a screen
- add an Image ( asset or network ) to the stack
- add some container with size and color on top of it
- add a CustomPaint and draw something with a CustomPainter
Target Platform : Web
Target OS version/browser : MacOS Chrome
Devices: iMac, iPhone, iPad
Code
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(App());
}
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: StackScreen(),
);
}
}
class StackScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
Opacity(opacity: 1,child: Image.asset('assets/img.png')),
CustomPaint(size: Size(200, 200), painter: MyPainter()),
Align(
alignment:Alignment.topRight,
child: Container(color: Colors.yellow, width: 100, height: 100),
),
RaisedButton(
child: Text('A Button', style: TextStyle(color: Colors.pink)),
onPressed: () {},
)
],
),
);
}
}
class MyPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
canvas.drawRect(
Rect.fromPoints(Offset.zero, size.bottomRight(Offset.zero)),
Paint()
..color = Colors.red
..style = PaintingStyle.fill);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return false;
}
}
Metadata
Metadata
Assignees
Labels
Loading, displaying, rendering imagesIt was better in the past than it is nowUI glitches reported at the engine/skia or impeller rendering levelAffects or could affect many people, though not necessarily a specific customer.flutter/packages/flutter repository. See also f: labels.Web applications specifically