Skip to content

Conversation

@darrenaustin
Copy link
Contributor

@darrenaustin darrenaustin commented Mar 8, 2021

This PR removes the MaterialApp widget's accentColor dependency per #56918.

The reference in question was used to set the GlowingOverscrollIndicator's color that is created for Material viewports. This PR updates this to now use the colorScheme.secondary for the overscroll indicator instead.

Breaking change

This is a breaking change, although most apps will not notice the change from theme.accentColor to theme.colorScheme.secondary, because they are typically the same color. For apps that do need a
specific color for the glow indicator, you can wrap your scrollable with something like:

    ScrollConfiguration(
      behavior: const ScrollBehavior(),
      child: GlowingOverscrollIndicator(
        axisDirection: AxisDirection.down,
        color: Colors.yellow,
        child: ListView.builder(
          ...
        ),
      ),
    ),

Which will force the glow color to yellow.

A new test was added to check verify the overscroll indicator color for Material apps.

This PR was tested against internal Google apps in cl/360771909

@darrenaustin darrenaustin added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Mar 8, 2021
@google-cla google-cla bot added the cla: yes label Mar 8, 2021
@darrenaustin darrenaustin requested a review from HansMuller March 8, 2021 23:22
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@darrenaustin darrenaustin merged commit 48f5674 into flutter:master Mar 9, 2021
@darrenaustin darrenaustin deleted the accent_material_app branch April 26, 2021 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants