Skip to content

[CupertinoPicker] Child paint transform happened to be null. #126491

Description

@kishan-dhankecha

Is there an existing issue for this?

Steps to reproduce

  1. Updated my old project environment sdk from sdk: '>=2.19.6 <3.0.0' to sdk: '>=3.0.0 <4.0.0'
  2. Make sure all the dependencies are safe to use within that change
  3. My app did build with no problems.
  4. In my Home Screen I have CupertinoPicker which was working fine before this change
  5. Now when I try to drag it gives me an error.

Expected results

CupetinoPicker should work as before even after changing SDK constraints unless SDK changes CupertinoPicker widgets properties.

Actual results

I get an error on dragging the picker to pick other items.

Code sample

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const CupertinoApp(
      title: 'Flutter Demo',
      theme: CupertinoThemeData(),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      child: Center(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 18),
          child: SizedBox(
            height: 120,
            child: CupertinoPicker(
              itemExtent: 55,
              diameterRatio: 0.9,
              onSelectedItemChanged: (idx) {
                //
              },
              children: ['1', '2', '3'].map<Widget>((diff) {
                return Center(child: Text(diff));
              }).toList(),
            ),
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Screen.Recording.2023-05-11.at.8.22.31.AM.mov

Logs

Logs
Launching lib/main.dart on macOS in debug mode...
2023-05-11 08:18:03.768 xcodebuild[20261:160371] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006020-001A11360EE8C01E }
{ platform:macOS, arch:x86_64, id:00006020-001A11360EE8C01E }
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
Connecting to VM Service at ws://127.0.0.1:58053/zqWb9056mo4=/ws
Reloaded 1 of 665 libraries in 167ms (compile: 35 ms, reload: 56 ms, reassemble: 52 ms).
Reloaded 1 of 665 libraries in 177ms (compile: 15 ms, reload: 65 ms, reassemble: 85 ms).

════════ Exception caught by gestures library ══════════════════════════════════
The following assertion was thrown while handling a pointer data packet:
Child paint transform happened to be null.

RenderListWheelViewport normally paints all of the children it has laid out.
Did you forget to update the ListWheelParentData.transform during the paint() call?
If this is intetional, change or remove this assertion accordingly.
When the exception was thrown, this was the stack
#0      RenderListWheelViewport._debugAssertValidPaintTransform
#1      RenderListWheelViewport.hitTestChildren
#2      RenderBox.hitTest
#3      RenderProxyBoxMixin.hitTestChildren
#4      RenderBox.hitTest
#5      RenderIgnorePointer.hitTest
#6      RenderProxyBoxMixin.hitTestChildren
#7      RenderBox.hitTest
#8      RenderProxyBoxMixin.hitTestChildren
#9      RenderProxyBoxWithHitTestBehavior.hitTest
#10     RenderProxyBoxMixin.hitTestChildren
#11     RenderProxyBoxWithHitTestBehavior.hitTest
#12     RenderProxyBoxMixin.hitTestChildren
#13     RenderProxyBoxWithHitTestBehavior.hitTest
#14     RenderProxyBoxMixin.hitTestChildren
#15     RenderBox.hitTest
#16     RenderProxyBoxMixin.hitTestChildren
#17     RenderBox.hitTest
#18     RenderBoxContainerDefaultsMixin.defaultHitTestChildren.<anonymous closure>
#19     BoxHitTestResult.addWithPaintOffset
#20     RenderBoxContainerDefaultsMixin.defaultHitTestChildren
#21     RenderStack.hitTestChildren
#22     RenderBox.hitTest
#23     RenderProxyBoxMixin.hitTestChildren
#24     RenderBox.hitTest
#25     RenderProxyBoxMixin.hitTestChildren
#26     RenderBox.hitTest
#27     RenderShiftedBox.hitTestChildren.<anonymous closure>
#28     BoxHitTestResult.addWithPaintOffset
#29     RenderShiftedBox.hitTestChildren
#30     RenderBox.hitTest
#31     RenderShiftedBox.hitTestChildren.<anonymous closure>
#32     BoxHitTestResult.addWithPaintOffset
#33     RenderShiftedBox.hitTestChildren
#34     RenderBox.hitTest
#35     RenderBoxContainerDefaultsMixin.defaultHitTestChildren.<anonymous closure>
#36     BoxHitTestResult.addWithPaintOffset
#37     RenderBoxContainerDefaultsMixin.defaultHitTestChildren
#38     RenderCustomMultiChildLayoutBox.hitTestChildren
#39     RenderBox.hitTest
#40     RenderProxyBoxMixin.hitTestChildren
#41     RenderBox.hitTest
#42     RenderProxyBoxMixin.hitTestChildren
#43     RenderBox.hitTest
#44     RenderPhysicalModel.hitTest
#45     RenderProxyBoxMixin.hitTestChildren
#46     RenderBox.hitTest
#47     RenderProxyBoxMixin.hitTestChildren
#48     RenderBox.hitTest
#49     RenderProxyBoxMixin.hitTestChildren
#50     RenderBox.hitTest
#51     RenderIgnorePointer.hitTest
#52     RenderBoxContainerDefaultsMixin.defaultHitTestChildren.<anonymous closure>
#53     BoxHitTestResult.addWithPaintOffset
#54     RenderBoxContainerDefaultsMixin.defaultHitTestChildren
#55     RenderStack.hitTestChildren
#56     RenderBox.hitTest
#57     RenderProxyBoxMixin.hitTestChildren
#58     RenderBox.hitTest
#59     RenderProxyBoxMixin.hitTestChildren
#60     RenderFractionalTranslation.hitTestChildren.<anonymous closure>
#61     BoxHitTestResult.addWithPaintOffset
#62     RenderFractionalTranslation.hitTestChildren
#63     RenderFractionalTranslation.hitTest
#64     RenderProxyBoxMixin.hitTestChildren
#65     RenderFractionalTranslation.hitTestChildren.<anonymous closure>
#66     BoxHitTestResult.addWithPaintOffset
#67     RenderFractionalTranslation.hitTestChildren
#68     RenderFractionalTranslation.hitTest
#69     RenderProxyBoxMixin.hitTestChildren
#70     RenderBox.hitTest
#71     RenderProxyBoxMixin.hitTestChildren
#72     RenderBox.hitTest
#73     RenderProxyBoxMixin.hitTestChildren
#74     RenderBox.hitTest
#75     RenderOffstage.hitTest
#76     RenderProxyBoxMixin.hitTestChildren
#77     RenderBox.hitTest
#78     _RenderTheaterMixin.hitTestChildren.childHitTest
#79     BoxHitTestResult.addWithPaintOffset
#80     _RenderTheaterMixin.hitTestChildren
#81     RenderBox.hitTest
#82     RenderProxyBoxMixin.hitTestChildren
#83     RenderBox.hitTest
#84     RenderAbsorbPointer.hitTest
#85     RenderProxyBoxMixin.hitTestChildren
#86     RenderProxyBoxWithHitTestBehavior.hitTest
#87     RenderProxyBoxMixin.hitTestChildren
#88     RenderBox.hitTest
#89     RenderProxyBoxMixin.hitTestChildren
#90     RenderCustomPaint.hitTestChildren
#91     RenderBox.hitTest
#92     RenderProxyBoxMixin.hitTestChildren
#93     RenderBox.hitTest
#94     RenderProxyBoxMixin.hitTestChildren
#95     RenderBox.hitTest
#96     RenderProxyBoxMixin.hitTestChildren
#97     RenderTapRegionSurface.hitTest
#98     RenderProxyBoxMixin.hitTestChildren
#99     RenderBox.hitTest
#100    RenderProxyBoxMixin.hitTestChildren
#101    RenderBox.hitTest
#102    RenderProxyBoxMixin.hitTestChildren
#103    RenderBox.hitTest
#104    RenderProxyBoxMixin.hitTestChildren
#105    RenderBox.hitTest
#106    RenderView.hitTest
#107    RenderView.hitTestMouseTrackers
#108    RendererBinding.dispatchEvent.<anonymous closure>
#109    MouseTracker.updateWithEvent
#110    RendererBinding.dispatchEvent
#111    GestureBinding._handlePointerEventImmediately
#112    GestureBinding.handlePointerEvent
#113    GestureBinding._flushPointerEventQueue
#114    GestureBinding._handlePointerDataPacket
#115    _invoke1 (dart:ui/hooks.dart:158:13)
#116    PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:382:7)
#117    _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by gestures library ══════════════════════════════════
Child paint transform happened to be null.
════════════════════════════════════════════════════════════════════════════════
Reloaded 1 of 665 libraries in 149ms (compile: 13 ms, reload: 65 ms, reassemble: 58 ms).

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.0, on macOS 13.3.1 22E261 darwin-arm64, locale en-IN)
    • Flutter version 3.10.0 on channel stable at /Users/kishan/development/sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 84a1e904f4 (2 days ago), 2023-05-09 07:41:44 -0700
    • Engine revision d44b5a94c9
    • Dart version 3.0.0
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/kishan/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.12.1

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

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.78.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.3.1 22E261 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 113.0.5672.92

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

• No issues found!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowf: cupertinoflutter/packages/flutter/cupertino repositoryf: gesturesflutter/packages/flutter/gestures repository.f: scrollingViewports, list views, slivers, etc.found in release: 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

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