Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] add clickable region in InputDecorator #104345

Open
cedvdb opened this issue May 22, 2022 · 1 comment
Open

[Proposal] add clickable region in InputDecorator #104345

cedvdb opened this issue May 22, 2022 · 1 comment
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@cedvdb
Copy link
Contributor

cedvdb commented May 22, 2022

use case

Achieving this kind of input with a inkWell on the left is pretty damn hard:

image

This is convoluted to do. You have to measure the height of the input decorator, remove the error height when there is an error, change the height when it's underline or outline border, when there is a label or not and so on. Then you have to wrap the input decorator in a stack, have the clickable region be the correct height and width, but it also has to be aligned correctly, the width also depends on a series of factor from InputDecorator. Then comes the aligments issues with the main textField...

I've tried everything, multiple times nothing is straightforward here.

Simply put to achieve something like that you have to hack your way around InputDecorator, because it's not build to do this kind of things. It makes packages harder to maintain that they need to be.

proposed

This is just an idea, I'm sure there are better ways but:

  • add prefixRegion & suffixRegion to input decorator which would add a inkWell around the prefix / suffix.
  • keep prefix correctly aligned
@danagbemava-nc danagbemava-nc added in triage Presently being triaged by the triage team c: new feature Nothing broken; request for a new capability framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. c: proposal A detailed proposal for a change to Flutter and removed in triage Presently being triaged by the triage team labels May 23, 2022
@HansMuller
Copy link
Contributor

Adding a pair of Widget valued properties - prefixRegion and suffixRegion - seems like a reasonable proposal. InputDecorator/InputDecoration are already hopelessly complex and one more pair of properties will not change that. The additional widgets would not affect the overall layout and could be made in _RenderDecoration.

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

No branches or pull requests

4 participants