Flutter Beautiful Login/SignUp Responsive UI Design with animation.
Tags: dart, flutter, beginners, tutorial
Published: 2022-03-07 09:42:26


## Flutter Beautiful Login/SignUp Responsive UI Design with animation.

![](https://cdn-images-1.medium.com/max/3840/1*DIvOQYEHNTTBxwidRpU2-Q.png)

## ContentsOfThisPost

* Introduction

![](https://cdn-images-1.medium.com/max/2000/1*dxdmFoStQ4guNAZYjkjcxg.gif)

* GitHub Repo
[](https://github.com/josephyaduvanshi/Auth-Login-SignUp-UI-Flutter-App-with-animation)

* Home Screen

* Login Screen

* Sign Up Screen

* Forget Password

* Routes

* Text Animation
>  INTRODUCTION
>  In this lesson, We will learn how to create a Flutter App with responsive UI.
>  First let’s create a home screen UI.

* Home Screen
{% gist https://gist.github.com/josephyaduvanshi/0a723d7c1a6026213631a7ed7be4cde8.js %}>  Having well organized code is always a good practice. So, I have created a new file in Screens Folder in the Library section.
>  Import the Material Library, and create a Stateful widget, You can use the snippets to create the boiler plate code. After creating the class, we will work on material widget because it provide us very good options for designing our UI. After you can wrap the material widget with another widget i.e. SafeArea.( **A widget that insets its child by sufficient padding to avoid intrusions by the operating system**. For example, this will indent the child by enough to avoid the status bar at the top of the screen.). If you are using VS code you can use refractor shortCut key to wrap Class with widget, padding, center etc. [ **For Windows: ctrl + . and For mac: cmd+. ]**
>  We will use scaffold class for the AppBar Widget. We can add title widget to create a title for our AppBar. title: takes Text widget which again takes a String dataType. We can further modify it with another widget called TextStyle Widget.
{% gist https://gist.github.com/josephyaduvanshi/46f88ce1bcf8c97228a040e28d4b05a0.js %}>  So let’s work on the body: of the Scaffold. So, We will use the [SingleChildScrollView](https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html) widget so that our UI will be compatible with different screen sizes. Again, wrap the widget with center so that our image will be aligned in center of the screen. Next we will use column widget to insert our images. To import the images we will use the [Image.asset(‘’)](https://docs.flutter.dev/development/ui/assets-and-images) widget. We can directly specify our image location address between the parenthesis within the Quotes. Before doing that we also need to update our [pubsec.yaml](https://dart.dev/tools/pub/pubspec) file.

![](https://cdn-images-1.medium.com/max/2924/1*I9IO57Hdaufp0_h6MG0L_w.png)
>  UnComment the asset section and add the location of the images folder. In my case, I have created a new folder named asset and added all the images there.
>  After adding the images you can use fit: and BoxFit to adjust the image in the body.
{% gist https://gist.github.com/josephyaduvanshi/78e1715a5102d90b11fea42632ade935.js %}>  Up to this it looks Simple, to make it little more beautiful we will add some animation. I am using a package for text animation. I.E. [AnimatedTextKit](https://pub.dev/packages/animated_text_kit) you can add it in dependencies or just run this command in the terminal.
{% gist https://gist.github.com/josephyaduvanshi/dd0015a0a38a0f41e8f39ef10250294e.js %}
![](https://cdn-images-1.medium.com/max/2000/1*7VzDrqvBEhjCw_g2oMlV_A.gif)
>  This is how our HomeScreen Looks after designing the Text with the Animated Text Kit package.

### Routes
>  In Flutter, screens and pages are called routes, To navigate from one page to another we will need routes. So, We have to implement in our code for an interactive UI. I have created a different file in Utilities folder for routes.

![](https://cdn-images-1.medium.com/max/2052/1*STHMuAHHA2XXZcajoRH0GQ.png)
>  To implement in our App we need to add it in our main.dart file.

![](https://cdn-images-1.medium.com/max/2752/1*u1UJuRfo3axaPhbp9zH4lA.png)

## Login Screen
>  Let’s see the code for our Login Screen.
{% gist https://gist.github.com/josephyaduvanshi/023d445098fbb256681719e492b1f485.js %}>  This is how it looks:

![](https://cdn-images-1.medium.com/max/2000/1*J4SW-vOIeEL-cSm9U7FLNw.gif)
>  The process is similar as the HomeScreen I.E Stateful classes, animation, Material, Column. etc, So I will discuss only the new added things in this lesson.
>  From the code, You can see I have used the TextFormField widget for the Email and password section. The TextFormField takes decoration: , hint text icons, label text and many more other widgets to create the form field interactive.
>  You can easily design as per your wish with the help of TextFormField. After designing the TextFormField, I have added a TextButton for the the forget password screen. Also added the route to the ForgetPassword screen. We can use [Navigator.PushNamed()](https://docs.flutter.dev/cookbook/navigation/named-routes) to perform the task. Similarly added the Sign In button using TextButton.icon and navigated it to the HomeScreen when pressed by the User.
>  Added the text Button just below the Sign In button for Sign Up. Which navigates the user to the Sign Up Screen.
>  Let’s see the code and its appearance.
{% gist https://gist.github.com/josephyaduvanshi/7d1400f5b4b25aa4072bdf7cd996205d.js %}>  This is how it looks:-)
>  The codes are almost similar to login Screen, Just gave a different touch for sign Up.

![](https://cdn-images-1.medium.com/max/2160/1*c8yf9QCh9Qydpi9YeAjoCw.jpeg)

## Forget Password
>  Code and Appearance:
{% gist https://gist.github.com/josephyaduvanshi/eefb5a893970b7fc911a2273ec652885.js %}>  This is how it Looks!

![](https://cdn-images-1.medium.com/max/2160/1*l3pAisGhIizoGHZwgF2PCg.jpeg)

If you read up to this, Thank You!

Share and Support! You can subscribe so that you won’t miss any latest posts from me. Also, I have given the Github Repo link. FoRK IT 🍴.