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

ListView renders a off pixel between a list item and a separator on Android #44008

Closed
njovy opened this issue Nov 1, 2019 · 3 comments
Closed
Labels
f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Comments

@njovy
Copy link

njovy commented Nov 1, 2019

Steps to Reproduce

import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.red,
        body: ListView.separated(
            itemBuilder: (context, _) => Container(
              color: Colors.white,
              child: ListTile(
                title: Text("TEST"),
              ),
            ),
            separatorBuilder:  (context, _) => Container(
              height: 1,
              color: Colors.white,
              padding: EdgeInsetsDirectional.only(start: 72),
              child: Container(height: 1, color: Colors.grey[100],width: double.infinity,),
            ),
            itemCount: 50),
      ),
    );
  }
}

Above is a problematic code that renders a background pixel between each item and a separator.

Android Screen
Android Screen

iOS Screen
iOS Screen

A background shouldn't be displayed as there is no padding or margin set among items. This only happens on Android. At first, I found this issue with SliverList but it happens with ListView as well. I tested this with a release mode but still renders a background color.

  • Target Platform: Android
  • Target OS version/browser: Api 28
  • Devices: Samsung Galaxy 9+

Logs

[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.14.4 18E226, locale en-KR)
    • Flutter version 1.9.1+hotfix.5 at /Users/captainpark/Library/Flutter/sdk
    • Framework revision 1aedbb1835 (2 weeks ago), 2019-10-17 08:37:27 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/captainpark/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.0, Build version 11A420a
    • CocoaPods version 1.7.1

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 34.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 40.2.4
    • Dart plugin version 192.7402

[✓] Connected device (1 available)
    • SM G965N • 21bd4fb43b037ece • android-arm64 • Android 9 (API 28)

• No issues found!

@HansMuller
Copy link
Contributor

This looks like a known problem with antialiasing and mapping from logical pixels to device pixels. There's an open issue for a documentation fix: #14288

More info about the problem can be found here:
#14288 (comment)
#17084 (comment)
#15035 (comment)

@HansMuller HansMuller added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Nov 1, 2019
@njovy
Copy link
Author

njovy commented Nov 2, 2019

@HansMuller Ahh I will track this issue there. Thank you!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

2 participants