Skip to content

RawScrollbar does not apply track or border color #106917

Closed

Description

@Piinks

RawScrollbar.trackColor and RawScrollbar.trackBorderColor do not work.
Fix incoming.

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    f: scrollingViewports, list views, slivers, etc.
    a: qualityA truly polished experience
    P1High-priority issues at the top of the work list
    on Jul 1, 2022
  2. self-assigned this
    on Jul 1, 2022
  3. MrPiou94 commented on Jul 5, 2022

    @MrPiou94

    Hello @Piinks ,
    This is my first contribution for Flutter, so I hope it will be sufficiently documented.
    After a few tries here is a proposal for the track color..

    trackVisibility: false, // Ignore colors well
    TrackFalse

    WithoutColor // Take default colors
    WithoutColor

    WithColor // Respects the chosen colors
    WithColor

    To do this, I modified the following files;
    flutter\packages\flutter\lib\src\widgets\scrollbar.dart

    1. In the creation of RawScrollbar, give the default color
        this.trackColor,
        this.trackBorderColor,
        this.trackColor = const Color(0x08000000),
        this.trackBorderColor = const Color(0x1a000000),
    1. Make colors not null because already initialized
      final Color? trackColor;
      final Color? trackBorderColor;
      final Color trackColor;
      final Color trackBorderColor;
    1. Show colors in updateScrollbarPainter only if trackVisibility: true
          ..trackColor = _showTrack ? const Color(0x08000000) : const Color(0x00000000)
          ..trackBorderColor = _showTrack ? const Color(0x1a000000) : const Color(0x00000000)
          ..trackColor = _showTrack ? widget.trackColor : const Color(0x00000000)
          ..trackBorderColor = _showTrack ? widget.trackBorderColor : const Color(0x00000000)

    I hope it will be useful for you, see you soon

  4. Piinks commented on Jul 6, 2022

    @Piinks
    ContributorAuthor

    Hey @MrPiou94 thanks for the detailed review! I already had a fix ready for this, it is in #107177. I am working on a large refactoring in this file and came across the bug.
    I am happy to hear you are interested in contributing! If you have not already done so, please check out the contributing guide. I'll be happy to give you a review on any changes you submit. Thanks - and welcome!

  5. github-actions commented on Jul 21, 2022

    @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.

  6. locked as resolved and limited conversation to collaborators on Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: qualityA truly polished experiencef: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions