Skip to content

[documentation] Overflow parameter removed from Stack Widget #66030

Closed

Description

@crtl

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

  1. Run flutter create bug.
  2. Use Stack widget

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)

Activity

  1. changed the title [-]Overflow paramter removed from stack[/-] [+]Overflow parameter removed from Stack Widget on latest master[/+] on Sep 17, 2020
  2. TahaTesser commented on Sep 17, 2020

    @TahaTesser
    Contributor

    Hi @crtl
    I can reproduce the issue

    overflow is also missing from master API docs https://api.flutter.dev/flutter/widgets/Stack-class.html
    still present in https://api.flutter.dev/flutter/widgets/Stack-class.html.

    Also missing from the source

    Stack({
    Key? key,
    this.alignment = AlignmentDirectional.topStart,
    this.textDirection,
    this.fit = StackFit.loose,
    this.clipBehavior = Clip.hardEdge,
    List<Widget> children = const <Widget>[],
    }) : assert(clipBehavior != null),
    super(key: key, children: children);

    code sample
    import 'package:flutter/material.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Material App',
          theme: ThemeData.dark(),
          home: Home(),
        );
      }
    }
    
    class Home extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text('Material App Bar'),
          ),
          body: Center(
            child: Stack(
              overflow: Overflow.clip,
              children: [
                FlutterLogo(
                  size: 500,
                ),
                Image.network(
                  'https://i.imgur.com/QCNbOAo.png',
                  height: 600,
                ),
              ],
            ),
          ),
          floatingActionButton: FloatingActionButton(
            child: Icon(Icons.add),
            onPressed: () {},
          ),
        );
      }
    }
    
    
    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

  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    c: regressionIt was better in the past than it is now
    and removed
    c: regressionIt was better in the past than it is now
    on Sep 17, 2020
  4. pingbird commented on Sep 17, 2020

    @pingbird
    Member

    This was an intended change as part of #61366, but seems to lack a migration guide.

  5. liyuqian commented on Sep 17, 2020

    @liyuqian
    Contributor

    Please see the migration guide that's originally posted in #59364

  6. pingbird commented on Sep 17, 2020

    @pingbird
    Member

    Ahhh, didn't look deep enough, thanks!

  7. changed the title [-]Overflow parameter removed from Stack Widget on latest master[/-] [+][documentation] Overflow parameter removed from Stack Widget[/+] on Sep 17, 2020
  8. crtl commented on Sep 17, 2020

    @crtl
    Author

    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.

  9. loic-hamdi commented on Sep 18, 2020

    @loic-hamdi

    From the migration guide, this wroked for me to fix the issue :

    If you previously used overflow: Overflow.visible, you shall replace it with clipBehavior: Clip.none.

    For ListWheelViewport widget, if you previously specified clipToSize, replace it with the corresponding clipBehavior: Clip.none for clipToSize = false and Clip.hardEdge for clipToSize = true.

  10. liyuqian commented on Sep 22, 2020

    @liyuqian
    Contributor

    @crtl : thanks for your suggestion! I'm adding Overflow back with deprecation in #66305

  11. github-actions commented on Aug 12, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    d: api docsIssues with https://api.flutter.dev/found in release: 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions