Asad Khan
Asad Khan

Reputation: 55

Layout bug: Not code related but design related

This time the bug i'm facing is not code related but design related. In the login page I have;

text view just saying Log In, then I have two input fields for email and password, the third widget is where the bug is. It is Forgot Password and it is constrained to the right side of the phone screen.

Now on my device, it is like "Forgot Password". But when I installed the application on another device, it went like "Fo rgo t Pa ss wor d?"

enter image description here

Words scattered vertically.

Here are the code screenshots,

enter image description here

enter image description here

The forgot password widget, I mentioned. then finally the button login.

enter image description here

I dont know whats up? Any suggestion guys?

Upvotes: 0

Views: 64

Answers (2)

Kalpesh Kundanani
Kalpesh Kundanani

Reputation: 5743

Add maxLines: 1, to your Text Widget:

Text(
   "Forgot Password?",
   maxLines: 1,
),

Upvotes: 0

Aamil Silawat
Aamil Silawat

Reputation: 8229

Remove the padding and add below code

               Align(
                      alignment: Alignment(1.2, 0),
                      child: FlatButton(   // You can use your own widget here
                        child: Text(
                          "Forgot Password?",
                          style: your text style;
                        ),
                        onPressed: () {},
                      ),
                    ),

Upvotes: 1

Related Questions