<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Programming Watcher on Medium]]></title>
        <description><![CDATA[Stories by Programming Watcher on Medium]]></description>
        <link>https://medium.com/@hussain93?source=rss-15c67a692a4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Programming Watcher on Medium</title>
            <link>https://medium.com/@hussain93?source=rss-15c67a692a4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 17:37:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hussain93/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Login page design using Flutter]]></title>
            <link>https://medium.com/@hussain93/login-page-design-using-flutter-3b2f56820b7b?source=rss-15c67a692a4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b2f56820b7b</guid>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Programming Watcher]]></dc:creator>
            <pubDate>Tue, 07 Feb 2023 09:02:47 GMT</pubDate>
            <atom:updated>2023-02-09T08:28:55.952Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey Developers,</p><p>Today, We are going to create login page using flutter. This is simple login screen using flutter and dart it will be perform same design on android, iOS and web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*vaY_pJfnUiImpdr7nCrGqg.jpeg" /></figure><p>We need to create a file with name of custom_text_field.dart. This is common class for all TextField which is use in login_screen.dart</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter/services.dart&#39;;<br><br>// ignore: must_be_immutable<br>class CustomTextField extends StatefulWidget {<br>  String? hint;<br>  bool obscureText;<br>  TextInputType? keyboardType;<br>  int? maxLength;<br>  bool enableShowAndHideIcon;<br><br>  CustomTextField({<br>    super.key,<br>    this.hint,<br>    this.obscureText = false,<br>    this.keyboardType,<br>    this.maxLength,<br>    this.enableShowAndHideIcon = false,<br>  });<br><br>  @override<br>  State&lt;CustomTextField&gt; createState() =&gt; _CustomTextFieldState();<br>}<br><br>class _CustomTextFieldState extends State&lt;CustomTextField&gt; {<br>  @override<br>  Widget build(BuildContext context) {<br>    return Card(<br>      child: Padding(<br>        padding: const EdgeInsets.only(left: 10.0, right: 10.0),<br>        child: SizedBox(<br>          height: 50.0,<br>          child: Center(<br>            child: TextField(<br>              obscureText: widget.obscureText,<br>              keyboardType: widget.keyboardType,<br>              inputFormatters: [<br>                LengthLimitingTextInputFormatter(widget.maxLength),<br>              ],<br>              style: const TextStyle(fontSize: 16.0),<br>              decoration: InputDecoration(<br>                border: InputBorder.none,<br>                hintText: widget.hint,<br>                suffixIcon: widget.enableShowAndHideIcon<br>                    ? IconButton(<br>                        icon: widget.obscureText<br>                            ? const Icon(Icons.visibility,color: Colors.amber,)<br>                            : const Icon(Icons.visibility_off,color: Colors.amber,),<br>                        onPressed: () {<br>                          widget.obscureText =<br>                              widget.obscureText == true ? false : true;<br>                          setState(() {});<br>                        },<br>                      )<br>                    : null,<br>              ),<br>            ),<br>          ),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><p>This is full code of login_screen.dart file</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter/services.dart&#39;;<br>import &#39;package:jivonjor/screens/custom_widgets/custom_text_field.dart&#39;;<br>import &#39;package:jivonjor/utils/app_images.dart&#39;;<br><br>class LoginScreen extends StatefulWidget {<br>  const LoginScreen({super.key});<br><br>  @override<br>  State&lt;LoginScreen&gt; createState() =&gt; _LoginScreenState();<br>}<br><br>class _LoginScreenState extends State&lt;LoginScreen&gt; {<br>  int isSelectedOTP = 1;<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Container(<br>      padding: const EdgeInsets.all(20.0),<br>      child: SingleChildScrollView(<br>        child: Column(<br>          mainAxisAlignment: MainAxisAlignment.center,<br>          children: [<br>            Center(<br>              child: Row(<br>                mainAxisAlignment: MainAxisAlignment.center,<br>                children: [<br>                  Expanded(<br>                    child: InkWell(<br>                      onTap: () {<br>                        setState(() {<br>                          isSelectedOTP = 1;<br>                        });<br>                      },<br>                      child: Container(<br>                        height: 80,<br>                        padding: const EdgeInsets.all(10.0),<br>                        decoration: BoxDecoration(<br>                          borderRadius:<br>                              const BorderRadius.all(Radius.circular(10.0)),<br>                          color: isSelectedOTP == 1 ? Colors.amber : Colors.white,<br>                          // ignore: prefer_const_literals_to_create_immutables<br>                          boxShadow: [<br>                            const BoxShadow(<br>                              color: Colors.grey,<br>                              offset: Offset(0.0, 1.0), //(x,y)<br>                              blurRadius: 6.0,<br>                            ),<br>                          ],<br>                        ),<br>                        child: Center(<br>                          child: Text(<br>                            &quot;Login With \n OTP&quot;.toUpperCase(),<br>                            style: TextStyle(<br>                                fontSize: 16,<br>                                color: isSelectedOTP == 1<br>                                    ? Colors.white<br>                                    : Colors.black,<br>                                fontWeight: FontWeight.bold),<br>                            textAlign: TextAlign.center,<br>                          ),<br>                        ),<br>                      ),<br>                    ),<br>                  ),<br>                  const VerticalDivider(<br>                    width: 20.0,<br>                  ),<br>                  Expanded(<br>                    child: InkWell(<br>                      onTap: () {<br>                        setState(() {<br>                          isSelectedOTP = 2;<br>                        });<br>                      },<br>                      child: Container(<br>                        height: 80,<br>                        padding: const EdgeInsets.all(10.0),<br>                        decoration: BoxDecoration(<br>                          borderRadius:<br>                              const BorderRadius.all(Radius.circular(10.0)),<br>                          color: isSelectedOTP == 1 ? Colors.white : Colors.amber,<br>                          // ignore: prefer_const_literals_to_create_immutables<br>                          boxShadow: [<br>                            const BoxShadow(<br>                              color: Colors.grey,<br>                              offset: Offset(0.0, 1.0), //(x,y)<br>                              blurRadius: 6.0,<br>                            ),<br>                          ],<br>                        ),<br>                        child: Center(<br>                          child: Text(<br>                            &quot;Login With \n Password&quot;.toUpperCase(),<br>                            style: TextStyle(<br>                                fontSize: 16,<br>                                color: isSelectedOTP == 1<br>                                    ? Colors.black<br>                                    : Colors.white,<br>                                fontWeight: FontWeight.bold),<br>                            textAlign: TextAlign.center,<br>                          ),<br>                        ),<br>                      ),<br>                    ),<br>                  )<br>                ],<br>              ),<br>            ),<br>            const SizedBox(<br>              height: 50.0,<br>            ),<br>            isSelectedOTP == 1<br>                ? SizedBox(<br>                  height: 170.0,<br>                  child: Column(<br>                      children: [<br>                        Card(<br>                          child: Row(<br>                            children: [<br>                              Container(<br>                                width: 100.0,<br>                                height: 50.0,<br>                                decoration: BoxDecoration(<br>                                  borderRadius:<br>                                      const BorderRadius.all(Radius.circular(5.0)),<br>                                  color: Colors.grey.shade200,<br>                                ),<br>                                child: Row(<br>                                  mainAxisAlignment: MainAxisAlignment.center,<br>                                  children: const [<br>                                    Image(<br>                                      image: AssetImage(AppImages.indiaFlag),<br>                                      height: 40.0,<br>                                      width: 40.0,<br>                                    ),<br>                                    Text(&quot; +91 &quot;),<br>                                    Icon(Icons.arrow_drop_down),<br>                                  ],<br>                                ),<br>                              ),<br>                              const VerticalDivider(<br>                                width: 5.0,<br>                              ),<br>                              Expanded(<br>                                child: SizedBox(<br>                                  height: 50.0,<br>                                  child: Center(<br>                                    child: TextField(<br>                                      keyboardType: TextInputType.phone,<br>                                      inputFormatters: [<br>                                        LengthLimitingTextInputFormatter(10),<br>                                      ],<br>                                      style: const TextStyle(fontSize: 16.0),<br>                                      decoration: const InputDecoration.collapsed(<br>                                          hintText: &quot;&quot;),<br>                                    ),<br>                                  ),<br>                                ),<br>                              ),<br>                            ],<br>                          ),<br>                        ),<br>                        Container(<br>                          width: double.infinity,<br>                          padding: const EdgeInsets.all(10.0),<br>                          child: const Text(<br>                            &quot;Send OTP&quot;,<br>                            textAlign: TextAlign.end,<br>                            style: TextStyle(<br>                              color: Colors.amber,<br>                              fontWeight: FontWeight.bold,<br>                            ),<br>                          ),<br>                        ),<br>                        CustomTextField(<br>                          hint: &quot;Enter OTP*&quot;,<br>                          keyboardType: TextInputType.phone,<br>                          obscureText: true,<br>                          maxLength: 4,<br>                          enableShowAndHideIcon: true,<br>                        ),<br>                      ],<br>                    ),<br>                )<br>                : SizedBox(<br>                  height: 170.0,<br>                  child: Column(<br>                      children: [<br>                        CustomTextField(<br>                          hint: &quot;Enter email/mobile number*&quot;,<br>                        ),<br>                        const SizedBox(<br>                          height: 10.0,<br>                        ),<br>                        CustomTextField(<br>                          hint: &quot;Enter password*&quot;,<br>                          obscureText: true,<br>                          enableShowAndHideIcon: true,<br>                        ),<br>                      ],<br>                    ),<br>                ),<br>            const SizedBox(<br>              height: 50.0,<br>            ),<br>            SizedBox(<br>              height: 50.0,<br>              width: 140.0,<br>              child: ElevatedButton(<br>                onPressed: (() {}),<br>                style: ButtonStyle(<br>                  backgroundColor: MaterialStateProperty.all&lt;Color&gt;(Colors.amber),<br>                  shape: MaterialStateProperty.all&lt;RoundedRectangleBorder&gt;(<br>                    RoundedRectangleBorder(<br>                      borderRadius: BorderRadius.circular(10.0),<br>                    ),<br>                  ),<br>                ),<br>                child: Text(&quot;Login&quot;.toUpperCase()),<br>              ),<br>            ),<br>            const SizedBox(<br>              height: 50.0,<br>            ),<br>            RichText(<br>                text: const TextSpan(<br>                    text: &quot;If you don&#39;t have an account?&quot;,<br>                    style: TextStyle(color: Colors.black26, fontSize: 15.0),<br>                    children: [<br>                  TextSpan(<br>                      text: &quot; Sign up&quot;,<br>                      style: TextStyle(color: Colors.amber, fontSize: 20.0))<br>                ])),<br>            const SizedBox(<br>              height: 20.0,<br>            ),<br>            const Text(<br>              &quot;OR&quot;,<br>              style: TextStyle(fontWeight: FontWeight.bold),<br>            ),<br>            const SizedBox(<br>              height: 20.0,<br>            ),<br>            Row(<br>              mainAxisAlignment: MainAxisAlignment.center,<br>              children: [<br>                IconButton(<br>                  onPressed: () {},<br>                  icon: Image.asset(AppImages.iconGoogle),<br>                  iconSize: 50.0,<br>                ),<br>                const VerticalDivider(<br>                  width: 20.0,<br>                ),<br>                IconButton(<br>                  onPressed: () {},<br>                  icon: Image.asset(AppImages.iconFacebook),<br>                  iconSize: 60.0,<br>                ),<br>              ],<br>            )<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><p>You can find the source code from this link <a href="https://github.com/taufik1993/loginpagedesign">https://github.com/taufik1993/loginpagedesign</a>.</p><p>If you have any doubts, Please leave the comments. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b2f56820b7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>