Skip to content

ListView scroll painting over Margin and Padding #18368

Closed

Description

@vbandrade

The code to reproduce the behavior is pretty straightforward:

import 'package:flutter/material.dart';

void main() async {
  runApp(MaterialApp(
    title: 'stack overflow',
    theme: ThemeData(
      primarySwatch: Colors.pink,
    ),
    routes: {},
    home: MyWidget(),
  ));
}

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Widget tagList = Container(
      color: Colors.green,
      height: 40.0,
      child: ListView.builder(
        itemCount: 10,
        scrollDirection: Axis.horizontal,
        itemBuilder: (BuildContext context, int index) {
          return Text("Text $index");
        },
      ),
    );

    return Scaffold(
        appBar: AppBar(
          title: Text("Test title"),
        ),
        body: Container(
          color: Colors.grey[400],
          child: tagList,
          padding: EdgeInsets.all(20.0),
          margin: EdgeInsets.all(20.0),
        ));
  }
}

Notice how the ListView items are being painted regardless of margin or padding.

scroll_error

Activity

  1. zoechi commented on Jun 11, 2018

    @zoechi
    Contributor

    Perhaps a bit far-fetched but somehow looks like #17716 (just horizontal instead of vertical)

  2. changed the title [-]ListView with horizontal scroll painting over Margin anf Padding[/-] [+]ListView scroll painting over Margin anf Padding[/+] on Jun 11, 2018
  3. vbandrade commented on Jun 11, 2018

    @vbandrade
    Author

    cant say if they're related but changed to Vertical scroll and the bug is there:
    vertical_scroll_error

  4. changed the title [-]ListView scroll painting over Margin anf Padding[/-] [+]ListView scroll painting over Margin and Padding[/+] on Jun 11, 2018
  5. zoechi commented on Jun 11, 2018

    @zoechi
    Contributor

    @vbandrade thanks for confirming.
    They are linked together now. If someone has a look he will probably check linked issues as well.

  6. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    on Jun 11, 2018
  7. goderbauer commented on Jun 12, 2018

    @goderbauer
    Member

    See also: #17426 and #17716, which are both caused by the same root cause.

  8. KiranChimple commented on Aug 10, 2018

    @KiranChimple

    Try to wrap the taglist widget container to SingleChildScrollView.

  9. github-actions commented on Sep 2, 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.

  10. locked as resolved and limited conversation to collaborators on Sep 2, 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

    frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions