-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repositoryf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
I was looking to use CupertinoTextField on iOS and TextField on Android for my app. The API differences between the two widgets for seemingly similar concepts feel rather unnecessary. Here are some examples:
- To add a piece of hint text, I need to supply that through the
decorationproperty onTextFieldbut theplaceholderproperty onCupertinoTextField. - The
decorationproperty onTextFieldtakes anInputDecoration, but the same property onCupertinoTextFieldtakes aBoxDecoration. - To add a prefix icon, I can use the
prefixIconproperty onInputDecoration, which I then pass to thedecorationproperty onTextField. However, I need to use theprefixproperty onCupertinoTextFieldto achieve a similar result.
Such differences make it difficult to 1) reason about how to use CupertinoTextField based on my knowledge about TextField, and 2) minimize platform-specific code when showing one of the two widgets based on the OS.
It could be helpful if a base text field is provided and design language is applied through theming or decoration.
leighajarett and cpboyd
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repositoryf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team