Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (insert|move|remove)RenderObjectChild methods in base class #123276

Merged
merged 2 commits into from Mar 23, 2023

Conversation

goderbauer
Copy link
Member

@goderbauer goderbauer commented Mar 22, 2023

Fixes #123087.

The reason why these now-removed asserts existed was to guide people in the migration from the old deprecated to the new methods. The old deprecated methods were removed in #98616, but we forgot to remove these asserts.

This change makes (insert|move|remove)RenderObjectChild abstract again, like the old ones were before they were deprecated, see https://github.com/flutter/flutter/pull/64254/files.

@flutter-dashboard flutter-dashboard bot added f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. labels Mar 22, 2023
@@ -856,7 +856,7 @@ class _CupertinoDialogRenderElement extends RenderObjectElement {
@override
void moveRenderObjectChild(RenderObject child, _AlertDialogSections oldSlot, _AlertDialogSections newSlot) {
if (!allowMoveRenderObjectChild) {
super.moveRenderObjectChild(child, oldSlot, newSlot);
assert(false);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From context and from the PR [1] that introduced the allowMoveRenderObjectChild flag it seemed like the assumption is that moveRenderObjectChild is never called when allowMoveRenderObjectChild is false, hence this change here.

[1] 2425814#diff-4ea2907696de4fecf42f2ca56278a7b1d90c28921b1259d18ae28b1a2553d8e8L413

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

@goderbauer goderbauer requested a review from Piinks March 22, 2023 20:30
@Piinks Piinks added team Infra upgrades, team productivity, code health, technical debt. See also team: labels. a: error message Error messages from the Flutter framework c: tech-debt Technical debt, code quality, testing, etc. labels Mar 22, 2023
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for cleaning this up!

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah it looks like render_object_element_test.dart has some expectations around these assertions.

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 22, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 23, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Mar 23, 2023

auto label is removed for flutter/flutter, pr: 123276, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 23, 2023
@goderbauer goderbauer merged commit 7f41ab2 into flutter:master Mar 23, 2023
70 checks passed
@goderbauer goderbauer deleted the deprecationFollowUp branch March 23, 2023 19:34
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2023
tarrinneal pushed a commit to flutter/packages that referenced this pull request Mar 24, 2023
…3535)

* cbdee5251 Roll Flutter Engine from 59acb5362098 to 12c822327825 (3 revisions) (flutter/flutter#123330)

* 897e3db40 Inject the gstatic CanvasKit CDN URL by default in `flutter build web` (flutter/flutter#122772)

* 5a36bddd2 Stop serving Observatory by default (flutter/flutter#122419)

* b212e7b32 implement Iterator and Comparable instead of extending them (flutter/flutter#123282)

* af6029c8f c0fbe5a53 Roll Dart SDK from 9256fffbd5af to e8e045620234 (1 revision) (flutter/engine#40561) (flutter/flutter#123336)

* 9dec4fbd1 FIX: NavigationDrawer hover/focus/pressed does not use indicatorShape (flutter/flutter#123325)

* 4907464a6 20ab040cd Roll Skia from ce5ff5cc03ce to c42320d53714 (2 revisions) (flutter/engine#40565) (flutter/flutter#123340)

* 28d40a4d2 Roll Packages from 75491e9 to 0826798 (5 revisions) (flutter/flutter#123342)

* 674ff1573 [macOS] Add platform_channel sample/test (flutter/flutter#123141)

* 7b7af9f34 roll packages (flutter/flutter#123339)

* 31798757e replace some ._() constructors with class modifiers (flutter/flutter#122765)

* 7f41ab25c Fix (insert|move|remove)RenderObjectChild methods in base class (flutter/flutter#123276)

* fccca4937 Refactor buildOverscrollIndicator (flutter/flutter#123246)

* 11bbce1b2 6b0933e74 [web] Add `dart:js_interop` to `_embedder.yaml`. (flutter/engine#40545) (flutter/flutter#123347)

* 716d25246 Remove prefer_const_constructors ignores (flutter/flutter#123284)

* 100cf21e2 Prefer enum over class. (flutter/flutter#123312)

* 5ef9b847a Expose toggle to textfield's opacity animation. (flutter/flutter#122474)

* d79f3aab0 Roll Flutter Engine from 6b0933e74965 to bdce896fb64f (2 revisions) (flutter/flutter#123351)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
…lutter#3535)

* cbdee5251 Roll Flutter Engine from 59acb5362098 to 12c822327825 (3 revisions) (flutter/flutter#123330)

* 897e3db40 Inject the gstatic CanvasKit CDN URL by default in `flutter build web` (flutter/flutter#122772)

* 5a36bddd2 Stop serving Observatory by default (flutter/flutter#122419)

* b212e7b32 implement Iterator and Comparable instead of extending them (flutter/flutter#123282)

* af6029c8f c0fbe5a53 Roll Dart SDK from 9256fffbd5af to e8e045620234 (1 revision) (flutter/engine#40561) (flutter/flutter#123336)

* 9dec4fbd1 FIX: NavigationDrawer hover/focus/pressed does not use indicatorShape (flutter/flutter#123325)

* 4907464a6 20ab040cd Roll Skia from ce5ff5cc03ce to c42320d53714 (2 revisions) (flutter/engine#40565) (flutter/flutter#123340)

* 28d40a4d2 Roll Packages from 75491e9 to 0826798 (5 revisions) (flutter/flutter#123342)

* 674ff1573 [macOS] Add platform_channel sample/test (flutter/flutter#123141)

* 7b7af9f34 roll packages (flutter/flutter#123339)

* 31798757e replace some ._() constructors with class modifiers (flutter/flutter#122765)

* 7f41ab25c Fix (insert|move|remove)RenderObjectChild methods in base class (flutter/flutter#123276)

* fccca4937 Refactor buildOverscrollIndicator (flutter/flutter#123246)

* 11bbce1b2 6b0933e74 [web] Add `dart:js_interop` to `_embedder.yaml`. (flutter/engine#40545) (flutter/flutter#123347)

* 716d25246 Remove prefer_const_constructors ignores (flutter/flutter#123284)

* 100cf21e2 Prefer enum over class. (flutter/flutter#123312)

* 5ef9b847a Expose toggle to textfield's opacity animation. (flutter/flutter#122474)

* d79f3aab0 Roll Flutter Engine from 6b0933e74965 to bdce896fb64f (2 revisions) (flutter/flutter#123351)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: error message Error messages from the Flutter framework autosubmit Merge PR when tree becomes green via auto submit App c: tech-debt Technical debt, code quality, testing, etc. f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RenderObjectElement insertRenderObjectChild seems to throw an error when it shouldn't
2 participants