Skip to content

CupertinoTextField unable to override the default placeholder color. #24175

@ffimnsr

Description

@ffimnsr

I'm having problems on overriding the default color for placeholder in CupertinoTextField. As I'm trying to set it white it always turns to gray. I've inspected the flutter source base and found this:

if (widget.placeholder != null && text.text.isEmpty) {
stackChildren.add(
Padding(
padding: widget.padding,
child: Text(
widget.placeholder,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: widget.style.merge(
const TextStyle(
color: _kInactiveTextColor,
fontWeight: FontWeight.w300,
),
),
),
),
);
}

Is there any other way around this?
Here is my flutter installation details:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.10.2, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] Android Studio (version 3.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
[✓] Connected device (1 available)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: fidelityMatching the OEM platforms betterf: cupertinoflutter/packages/flutter/cupertino repositoryframeworkflutter/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