Skip to content

SearchDelegate should respect InputDecoration theme override #19734

@DFreds

Description

@DFreds

Internal: b/165582972

Currently, the search bar contained in SearchDelegate uses the following code to set the colors of the app:

  ThemeData appBarTheme(BuildContext context) {
    assert(context != null);
    final ThemeData theme = Theme.of(context);
    assert(theme != null);
    return theme.copyWith(
      primaryColor: Colors.white,
      primaryIconTheme: theme.primaryIconTheme.copyWith(color: Colors.grey),
      primaryColorBrightness: Brightness.light,
      primaryTextTheme: theme.textTheme,
    );
  }

This requires a specific override of appBarTheme for each SearchDelegate or else it looks horrible for dark themes (even the default ThemeData.dark()). Frankly, I don't see why it needs to explicitly specify Colors.white or Colors.grey. It should inherit something from the currently applied theme just like the regular app bar.

I attached two images (light and dark) to prove my point.

screenshot_1532475976
screenshot_1532475953

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: qualityA truly polished experiencecustomer: googleVarious Google teamsf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions