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

TODO : TextField #7

Closed
florent37 opened this issue Feb 21, 2020 · 2 comments
Closed

TODO : TextField #7

florent37 opened this issue Feb 21, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@florent37
Copy link
Member

florent37 commented Feb 21, 2020

Capture d’écran 2020-02-21 à 11 06 13

proposals :

  1. use the real TextField
TextField(
  decoration: NeumortphicDecoration(
    //TODO
  ),
);
  1. create a widget
NeumortphicTextField(
      //TODO
)
@florent37 florent37 added the enhancement New feature or request label Feb 21, 2020
@florent37 florent37 changed the title TextField TODO : TextField Mar 4, 2020
@florent37
Copy link
Member Author

florent37 commented Mar 23, 2020

won't be developped for neumorphic, just wrap a textfield inside a neumorphic element :

class _TextField extends StatefulWidget {
  final String hint;

  final ValueChanged<String> onChanged;

  _TextField({this.onChanged});

  @override
  __TextFieldState createState() => __TextFieldState();
}

class __TextFieldState extends State<_TextField> {
  TextEditingController _controller;

  @override
  void initState() {
    _controller = TextEditingController(text: null);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Neumorphic(
          margin: EdgeInsets.only(left: 8, right: 8, top: 2, bottom: 4),
          boxShape: NeumorphicBoxShape.stadium(),
          style: NeumorphicStyle(depth: NeumorphicTheme.embossDepth(context)),
          padding: EdgeInsets.symmetric(vertical: 2, horizontal: 18),
          child: TextField(
            onChanged: this.widget.onChanged,
            controller: _controller,
            decoration: InputDecoration.collapsed(hintText: "Search for ..."),
          ),
    );
  }
}

@Kiruel
Copy link

Kiruel commented Dec 5, 2022

But with this implementation, you don't handle the errors case, or even the maxLength text. I think this issue should be re-open in order to have a proper decoration for a InputDecoration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants