I want to show a validation message in a overlay box at the nearest of textformfield . Can you help me? I want like this.
Asked
Active
Viewed 466 times
1

User
- 105
- 10
-
Can you include your code snippet? – Md. Yeasin Sheikh Aug 30 '21 at 17:24
2 Answers
1
Try below code using Tooltip Widget hope its help to you refer Tooltip Widget here
TextFormField(
textCapitalization: TextCapitalization.sentences,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Name',
hintText: 'Card Holder Name',
suffixIcon: Tooltip(
message: 'Required',
child: Icon(
Icons.info,
),
),
),
),

Ravindra S. Patil
- 11,757
- 3
- 13
- 40
0
Result you can use errorStyle
to modify
Code snippet
Padding(
padding: const EdgeInsets.all(8.0),
child: TextField(
controller: controller,
decoration: InputDecoration(
border: OutlineInputBorder(),
errorText: _isError? " required" : null,
),
),
),

Md. Yeasin Sheikh
- 54,221
- 7
- 29
- 56