Skip to content

Define TextStyle with dynamic values #38584

@feinstein

Description

@feinstein

TextStyle only has a const constructor, so I can't create one using a runtime value like:

TextStyle(
        color: Theme.of(context).primaryColor, // Error as this is not a const Color
        fontWeight: FontWeight.w500,
        fontSize: 20
);

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