-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
I have dialog with gradient background and scrollable content.
It fails when i call showDialog with following stacktrace:
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during a scheduler callback:
Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/dom_canvas.dart:74:12
paint.shader == null
is not true
When the exception was thrown, this was the stack:
package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 196:49 throw_
package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 26:3 assertFailed
package:build_web_compilers/lib/_engine/engine/dom_canvas.dart 74:28 [_drawRect]
package:build_web_compilers/lib/_engine/engine/dom_canvas.dart 136:28 drawRRect
package:build_web_compilers/lib/_engine/engine/surface/recording_canvas.dart 865:11 apply
package:build_web_compilers/lib/_engine/engine/surface/recording_canvas.dart 78:18 apply
package:build_web_compilers/lib/_engine/engine/surface/picture.dart 219:29 [_applyDomPaint]
package:build_web_compilers/lib/_engine/engine/surface/picture.dart 209:7 applyPaint
package:build_web_compilers/lib/_engine/engine/surface/picture.dart 521:5 [_applyPaint]
package:build_web_compilers/lib/_engine/engine/surface/picture.dart 534:5 apply
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 644:5 build
package:build_web_compilers/lib/_engine/engine/surface/picture.dart 540:11 build
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 964:14 build
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 964:14 build
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 964:14 build
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 964:14 build
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 964:14 build
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 964:14 build
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 964:14 build
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 1054:17 [_updateZeroToMany]
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 992:7 update
package:build_web_compilers/lib/_engine/engine/surface/offset.dart 45:11 update
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 1209:17 [_updateManyToMany]
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 998:7 update
package:build_web_compilers/lib/_engine/engine/surface/transform.dart 42:11 update
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 1113:15 [_updateManyToOne]
package:build_web_compilers/lib/_engine/engine/surface/surface.dart 994:7 update
package:build_web_compilers/lib/_engine/engine/surface/scene_builder.dart 518:23 build
package:flutter/src/rendering/layer.dart 807:35 buildScene
package:flutter/src/rendering/view.dart 230:36 compositeFrame
package:flutter/src/rendering/binding.dart 405:18 drawFrame
package:flutter/src/widgets/binding.dart 881:13 drawFrame
package:flutter/src/rendering/binding.dart 283:5 [_handlePersistentFrameCallback]
package:flutter/src/scheduler/binding.dart 1109:15 [_invokeFrameCallback]
package:flutter/src/scheduler/binding.dart 1048:9 handleDrawFrame
package:flutter/src/scheduler/binding.dart 964:5 [_handleDrawFrame]
package:build_web_compilers/lib/_engine/engine.dart 190:21 <fn>
════════════════════════════════════════════════════════════════════════════════════════════════════
Another exception was thrown: Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/surface/surface.dart:986:12
Another exception was thrown: Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/surface/scene_builder.dart:267:12
Steps to Reproduce
The issue is reproduced on master. Similar code works on beta.
SingleChildScrollView causes the issue in this case.
Removing SingleChildScrollView, or moving it up the Widget tree, or replacing gradient with plain color "solves" the issue (but content either wouldn't scroll or wouldn't look as designed).
class MyHomePage extends StatelessWidget {
const MyHomePage({Key key, this.title}) : super(key: key);
final String title;
Widget build(BuildContext context) {
return Center(
child: RaisedButton(
child: Text('Press me'),
onPressed: () {
_showDialog(context);
},
),
);
}
void _showDialog(context) {
showDialog(
context: context,
builder: (BuildContext context) {
return Center(
child: Container(
constraints: BoxConstraints(maxWidth: 450.0, maxHeight: 600.0),
margin: const EdgeInsets.all(24.0),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(16.0)),
clipBehavior: Clip.antiAlias,
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [Color(0xFFcfdfd2), Color(0xFF042a85)],
),
borderRadius: BorderRadius.all(Radius.circular(16.0)),
),
child: SizedBox(width: double.infinity, height: 600.0),
),
),
),
),
);
},
);
}
}Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.14.7-pre.83, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Community Edition (version 2019.2)
[✓] Connected device (3 available)
• No issues found!