Repository navigation
[documentation] Overflow parameter removed from Stack Widget #66030
Copy link
Copy link
Closed
Labels
d: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/found in release: 1.22Found to occur in 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on
Description
After ugprading Im getting the following error:
lib/widgets/video_player/video_player_widget.dart:255:15: Error: No named parameter with the name 'overflow'.
overflow: Overflow.clip,
^^^^^^^^
../sdk/packages/flutter/lib/src/widgets/basic.dart:3273:3: Context: Found this candidate, but the arguments don't match.
Stack({
^^^^^
I get an error on every Stack widget using the overflow parameter.
Steps to Reproduce
- Run
flutter create bug. - Use
Stackwidget
Expected results:
overflow parameter should be available
Actual results:
overflow attribute does not exist
Logs
[√] Flutter (Channel master, 1.22.0-10.0.pre.221, on Microsoft Windows [Version 10.0.18363.1082], locale en-DE)
• Flutter version 1.22.0-10.0.pre.221 at D:\dev\flutter\sdk
• Framework revision fa646339d6 (14 hours ago), 2020-09-16 17:47:04 -0700
• Engine revision 933f811d94
• Dart version 2.10.0 (build 2.10.0-135.0.dev)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\Marvin\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
d: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/found in release: 1.22Found to occur in 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on
Activity
[-]Overflow paramter removed from stack[/-][+]Overflow parameter removed from Stack Widget on latest master[/+]TahaTesser commentedon Sep 17, 2020
Hi @crtl
I can reproduce the issue
overflowis also missing from master API docs https://api.flutter.dev/flutter/widgets/Stack-class.htmlstill present in https://api.flutter.dev/flutter/widgets/Stack-class.html.
Also missing from the source
flutter/packages/flutter/lib/src/widgets/basic.dart
Lines 3273 to 3282 in d15da04
code sample
flutter doctor -v
[✓] Flutter (Channel master, 1.22.0-10.0.pre.222, on Microsoft Windows [Version 10.0.19041.508], locale en-US) • Flutter version 1.22.0-10.0.pre.222 at C:\Code\flutter_master • Framework revision d15da04f4f (47 minutes ago), 2020-09-17 07:51:28 -0700 • Engine revision 933f811d94 • Dart version 2.10.0 (build 2.10.0-135.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at C:\Code\sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = C:\Code\sdk • Java binary at: C:\Code\android-studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [✓] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.3) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.7.30503.244 • Windows 10 SDK version 10.0.18362.0 [✓] Android Studio (version 4.0) • Android Studio at C:\Code\android-studio • Flutter plugin version 49.0.2 • Dart plugin version 193.7547 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [✓] VS Code (version 1.49.0) • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.14.1 [✓] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19041.508] • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 85.0.4183.102 • No issues found!I found it was removed intentionally 7948a78
Needs some explanation
CC: @liyuqian
pingbird commentedon Sep 17, 2020
This was an intended change as part of #61366, but seems to lack a migration guide.
liyuqian commentedon Sep 17, 2020
Please see the migration guide that's originally posted in #59364
pingbird commentedon Sep 17, 2020
Ahhh, didn't look deep enough, thanks!
[-]Overflow parameter removed from Stack Widget on latest master[/-][+][documentation] Overflow parameter removed from Stack Widget[/+]crtl commentedon Sep 17, 2020
It should be marked deprecated for a while first. No one will know that it changed and a lot of libraries will stop working if this change is forced to fast. At least I havent seen it deprecated before.
loic-hamdi commentedon Sep 18, 2020
From the migration guide, this wroked for me to fix the issue :
If you previously used
overflow: Overflow.visible, you shall replace it withclipBehavior: Clip.none.For
ListWheelViewportwidget, if you previously specifiedclipToSize, replace it with the correspondingclipBehavior:Clip.noneforclipToSize = falseandClip.hardEdgeforclipToSize = true.Replaced Stack widget's overflow to clipBehavior
liyuqian commentedon Sep 22, 2020
@crtl : thanks for your suggestion! I'm adding
Overflowback with deprecation in #66305Overflow in Stack is deprecated. Use [Stack.clipBehavior] instead.
github-actions commentedon Aug 12, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.