Im looking for a way to show an example of a text input expected in a TextFormField in Flutter, the idea would be similar to using a hintText, but this hint not disappearing and adapting to the users input, i do not need formatting or anything.
I tried putting one textFormField stacked on another but this hacky way creates new issues that i cannot resolve.
The exprected result would be similar to the following image:

Code Snippet:
Stack(
children: [
TextFormField(
scrollController: scrollController,
focusNode: focusNode,
controller: textController,
keyboardType: widget.textInputType,
decoration: InputDecoration(
hintTextDirection: TextDirection.ltr,
labelText: "label",
hintText: "Hint",
fillColor: white,
),
),
if (IsTextFormSelected)
TextFormField(
scrollController: secondScrollController,
focusNode: secondFocusNode,
controller: secondController,
textCapitalization: TextCapitalization.sentences,
decoration: InputDecoration(
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
hintTextDirection: TextDirection.ltr,
fillColor: Colors.transparent,
),
onTap: () {
// RequestsFocus from mainTextFormField onTap
focusNode.requestFocus();
},
),
],
);
I would really appreciate any ideas.
Try below code using Single TextField:
TextFormField(
textCapitalization: TextCapitalization.sentences,
decoration: InputDecoration(
labelText: "label",
hintText: "Hint",
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
hintTextDirection: TextDirection.ltr,
fillColor: Colors.transparent,
),
),
Result-> 
Result-> 
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With