Skip to content

Transform.scale with scale: 0 and any non-null filterQuality breaks on the Web #181411

Description

@PiotrRogulski

Steps to reproduce

  1. Wrap your widget in a Transform.scale(scale: 0, child: ...)
  2. The app renders correctly
  3. Specify a non-null filter quality
  4. On the web: the app doesn't render, and an exception is thrown. On other platforms (e.g., macOS), the app renders correctly

Expected results

The app renders correctly with the specified filter quality on the Web as well.

Actual results

A TypeError is thrown, and no further frame is produced. The app is responsive to pointer events – buttons on the page are still clickable.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisSize: .min,
            children: [
              Transform.scale(
                scale: 0,
                // >>> Uncomment to break the app <<<
                // filterQuality: .low,
                child: const Text('Hello, World!'),
              ),
              ElevatedButton(
                onPressed: () => print('hello!'),
                child: const Text('Click me'),
              ),
            ],
          ),
        ),
      ),
    ),
  );
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Error
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getOutputBounds')
    at Object.SkImageFilter$124getOutputBounds [as SkImageFilter|getOutputBounds] (canvaskit_api.dart:1078:13)
    at image_filter.dart:86:39
    at dartDevEmbedder.defineLibrary._engine._CkMatrixImageFilter.new.withSkImageFilter (image_filter.dart:199:5)
    at dartDevEmbedder.defineLibrary._engine._CkMatrixImageFilter.new.filterBounds (image_filter.dart:85:5)
    at PrerollVisitor.visitImageFilter (layer_visitor.dart:150:44)
    at dartDevEmbedder.defineLibrary._engine.ImageFilterEngineLayer.new.accept (layer.dart:189:19)
    at PrerollVisitor.prerollChildren (layer_visitor.dart:65:12)
    at PrerollVisitor.visitTransform (layer_visitor.dart:209:38)
    at PrerollVisitor.visitOffset (layer_visitor.dart:157:5)
    at OffsetEngineLayer.accept (layer.dart:176:19)
    at PrerollVisitor.prerollChildren (layer_visitor.dart:65:12)
    at PrerollVisitor.visitTransform (layer_visitor.dart:209:38)
    at PrerollVisitor.visitOffset (layer_visitor.dart:157:5)
    at OffsetEngineLayer.accept (layer.dart:176:19)
    at PrerollVisitor.prerollChildren (layer_visitor.dart:65:12)
    at PrerollVisitor.visitTransform (layer_visitor.dart:209:38)
    at TransformEngineLayer.accept (layer.dart:162:19)
    at PrerollVisitor.prerollChildren (layer_visitor.dart:65:12)
    at PrerollVisitor.prerollContainerLayer (layer_visitor.dart:76:29)
    at PrerollVisitor.visitRoot (layer_visitor.dart:81:5)
    at RootLayer.accept (layer.dart:63:19)
    at LayerTree.preroll (layer_tree.dart:25:5)
    at layer_tree.dart:84:16
    at Object.timeAction (profiler.dart:35:18)
    at Frame.raster (layer_tree.dart:83:5)
    at rasterizer.dart:85:20
    at async_patch.dart:623:19
    at async_patch.dart:648:23
    at async_patch.dart:594:19
    at _RootZone.runUnary (zone.dart:962:54)
    at _FutureListener.handleValue (future_impl.dart:222:18)
    at handleValueCallback (future_impl.dart:948:44)
    at _Future._propagateToListeners (future_impl.dart:977:13)
    at [_completeWithValue] (future_impl.dart:720:5)
    at _AsyncAwaitCompleter.complete (async_patch.dart:504:7)
    at Object._asyncReturn (async_patch.dart:571:12)
    at offscreen_canvas_rasterizer.dart:69:3
    at async_patch.dart:623:19
    at async_patch.dart:648:23
    at async_patch.dart:594:19
    at _RootZone.runUnary (zone.dart:962:54)
    at _FutureListener.handleValue (future_impl.dart:222:18)
    at handleValueCallback (future_impl.dart:948:44)
    at _Future._propagateToListeners (future_impl.dart:977:13)
    at future_impl.dart:543:9
    at Object._microtaskLoop (schedule_microtask.dart:40:34)
    at Object._startMicrotaskLoop (schedule_microtask.dart:49:5)
    at tear (operations.dart:118:77)
    at async_patch.dart:188:69             <fn>

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.41.0-1.0.pre-250, on macOS 26.3 25D5101c darwin-arm64, locale en-US) [782ms]
    • Flutter version 3.41.0-1.0.pre-250 on channel master at /Users/piotr/fvm/versions/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 72321c82f9 (3 hours ago), 2026-01-23 18:29:21 +0100
    • Engine revision 5f58fad42f
    • Dart version 3.12.0 (build 3.12.0-63.0.dev)
    • DevTools version 2.54.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-dart-data-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, no-enable-uiscene-migration, enable-riscv64

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0-rc1) [865ms]
    • Android SDK at /Users/piotr/Library/Android/sdk
    • Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A)
    • Platform android-36, build-tools 36.1.0-rc1
    • ANDROID_HOME = /Users/piotr/Library/Android/sdk
    • Java binary at: /Users/piotr/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [554ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C52
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [4ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (2 available) [5.8s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 26.3 25D5101c darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 144.0.7559.97

[✓] Network resources [228ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolee: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webengineflutter/engine related. See also e: labels.found in release: 3.38Found to occur in 3.38found in release: 3.41Found to occur in 3.41has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions