Skip to content

MDC-103 - Codelabs page - Step 5 - overriding accentColor doesn't work #128

Closed
@bonlot

Description

@bonlot

I realise there are already closed bugs regarding this but I'd like to suggest that the code be checked again.

In my experience, to get the final pictured behaviour of the login screen in step 5 of MDC-103 on the codelabs page (with the border of the focused TextField being coloured kShrineBrown900) it is necessary to override primaryColor. Overriding accentColor doesn't work.

But overriding accentColor in step 9 does give the final pictured behaviour of the login screen (with the border of the focused TextField being coloured kShrineAltYellow).

I have checked this with the 104-starter_and_103-complete branch GitHub code.

With reference to the discussion of issue #106, looking through input_decorator.dart this behaviour appears to make sense.

In step 5, the ThemeData Brightness is set to light so, as far as I can tell, _getActiveColor (and _getDefaultBorder) of input_decorator.dart ultimately result in primaryColor being used for the borderColor of the focused TextField.

In step 9, the ThemeData Brightness is set to dark so _getActiveColor ultimately results in accentColor being used for the borderColor of the focused TextField.

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions