Overlay box when validation occur at the end of textform field in flutter

170

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,
                ),
              ),
            ),
          ),

Result of your screen enter image description here

Share:
170
User
Author by

User

Updated on December 31, 2022

Comments

  • User
    User over 1 year

    I want to show a validation message in a overlay box at the nearest of textformfield . Can you help me? I want like this.This image shows what I want

    • Yeasin Sheikh
      Yeasin Sheikh over 2 years
      Can you include your code snippet?
  • User
    User over 2 years
    Thank you. I solved this solution by custom tooltip by using overlay.
  • User
    User over 2 years
    It is the correct way. But I want like that image.
  • sulli110
    sulli110 about 2 years
    @User can you post your code snippet to show how you used custom tool tip by using overlay
  • Ravindra S. Patil
    Ravindra S. Patil about 2 years
    @sulli110 try to test my answer code