Skip to content

[Documentation] AppBarTheme toolbarTextStyle and titleTextStyle documentation not following the current behavior #86127

Closed

Description

@Charly6596

The documentation says we need to enable backwardsCompatibility to use toolbarTextStyle and titleTextStyle, but I can only use them when I disable it.

I've made a repo with a piece of code to try the functionality: https://github.com/Charly6596/Title-text-style-issue

Screenshots

image
image

The fact that the documentation says that toolbarTextStyle is obsolete also confuses me.

/// Overrides the default value for the obsolete [AppBar.toolbarTextStyle]

By reading #71184 (comment) I assume that the documentation should be fixed and the behaviour is correct.

Also, the AppBar documentation isn't updated regarding to the backwardsCompatibility flag.

The current behaviour can be observed in the implementation:

TextStyle? toolbarTextStyle = backwardsCompatibility
? widget.textTheme?.bodyText2
?? appBarTheme.textTheme?.bodyText2
?? theme.primaryTextTheme.bodyText2
: widget.toolbarTextStyle
?? appBarTheme.toolbarTextStyle
?? theme.textTheme.bodyText2?.copyWith(color: foregroundColor);
TextStyle? titleTextStyle = backwardsCompatibility
? widget.textTheme?.headline6
?? appBarTheme.textTheme?.headline6
?? theme.primaryTextTheme.headline6
: widget.titleTextStyle
?? appBarTheme.titleTextStyle
?? theme.textTheme.headline6?.copyWith(color: foregroundColor);

The fact that #81675 (comment) mentions that the value should be true to use titleTextStyle confused me, commenting it just so others can be redirected here if they had the same problem as the OP

Activity

  1. added
    in triagePresently being triaged by the triage team
    d: api docsIssues with https://api.flutter.dev/
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Jul 9, 2021
  2. HansMuller commented on Jul 12, 2021

    @HansMuller
    Contributor

    You are correct and sorry about that. The fixed docs are about to land in #86198, along with a slew of other changes.

  3. github-actions commented on Jul 30, 2021

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    d: api docsIssues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packageswaiting 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