• Home
  • Introduction
  • Installation
  • Portfolio
  • Tutorial
    • Flutter
    • Dart
    • Android
    • Java
    • J2EE
    • Kotlin
    • Jetpack Compose
    • Interview Questions
  • Contact Us
Search
Flutter Tutorial
  • Home
  • Introduction
  • Installation
  • Portfolio
  • Tutorial
    • Flutter
    • Dart
    • Android
    • Java
    • J2EE
    • Kotlin
    • Jetpack Compose
    • Interview Questions
  • Contact Us
Home Flutter Login Scroll Disable Background Inside Stack In Flutter
  • Flutter
  • Tutorial

Login Scroll Disable Background Inside Stack In Flutter

October 20, 2020
WhatsApp
Facebook
Google+
Pinterest
Telegram
Twitter
ReddIt
Email
Print
Tumblr
StumbleUpon
VK
Digg
LINE
Viber

    Login Scroll Disable Background Inside Stack In Flutter :

    Screenshot :

    Login Scroll Disable Background Inside Stack In Flutter

    Login scroll disable background inside stack.dart

    import 'package:flutter/gestures.dart';
    import 'package:flutter/material.dart';
    import 'package:flutter_screenutil/screenutil.dart';
    
    class LoginPage extends StatefulWidget {
      final bool enableArrow;
      LoginPage({Key key, this.enableArrow = false}) : super(key: key);
    
      @override
      _LoginPageState createState() => _LoginPageState();
    }
    
    class _LoginPageState extends State<LoginPage> {
      bool pwdSwitch = false;
      GlobalKey _formKey = GlobalKey<FormState>();
      TextEditingController _unameController = TextEditingController();
      TextEditingController _pwdController = TextEditingController();
    
      @override
      Widget build(BuildContext context) {
        ScreenUtil.init(context,
            width: 375, height: 812 - 44 - 34, allowFontScaling: true);
    
        return Container(
            decoration: BoxDecoration(
                image: DecorationImage(
                    image: AssetImage('assets/login/bg.png'), fit: BoxFit.cover)),
            child: Scaffold(
                backgroundColor: Colors.transparent,
                body: SingleChildScrollView(
                    child: Stack(children: <Widget>[
                  Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: <Widget>[
                        SizedBox(height: duSetHeight(160)),
                        Padding(
                            padding: EdgeInsets.symmetric(horizontal: 20),
                            child: Container(
                                width: double.infinity,
                                padding: EdgeInsets.symmetric(horizontal: 20),
                                decoration: BoxDecoration(
                                    color: Colors.white.withOpacity(.7),
                                    borderRadius:
                                        BorderRadius.all(Radius.circular(20))),
                                child: Column(
                                    mainAxisAlignment: MainAxisAlignment.start,
                                    crossAxisAlignment: CrossAxisAlignment.center,
                                    children: <Widget>[
                                      SizedBox(height: duSetHeight(80)),
                                      Form(
                                          key: _formKey,
                                          autovalidateMode:
                                              AutovalidateMode.disabled,
                                          child: Column(
                                              mainAxisAlignment:
                                                  MainAxisAlignment.start,
                                              crossAxisAlignment:
                                                  CrossAxisAlignment.center,
                                              children: <Widget>[
                                                TextFormField(
                                                    controller: _unameController,
                                                    decoration: InputDecoration(
                                                        prefixIcon: Icon(
                                                          Icons.account_circle,
                                                          color: Colors.blueAccent,
                                                        ),
                                                        filled: true,
                                                        fillColor:
                                                            HexColor('#EFEFEF'),
                                                        enabledBorder: OutlineInputBorder(
                                                            borderSide: BorderSide(
                                                                color: Color(
                                                                    0x00FF0000)),
                                                            borderRadius:
                                                                BorderRadius.all(
                                                                    Radius.circular(
                                                                        100))),
                                                        hintText: 'Email',
                                                        focusedBorder: OutlineInputBorder(
                                                            borderSide: BorderSide(
                                                                color: Color(
                                                                    0x00000000)),
                                                            borderRadius:
                                                                BorderRadius.all(
                                                                    Radius.circular(
                                                                        100))))),
                                                SizedBox(height: duSetHeight(20)),
                                                TextFormField(
                                                  controller: _pwdController,
                                                  keyboardType:
                                                      TextInputType.visiblePassword,
                                                  decoration: InputDecoration(
                                                      prefixIcon: Icon(
                                                        Icons.offline_bolt,
                                                        color: Colors.blueAccent,
                                                      ),
                                                      filled: true,
                                                      fillColor:
                                                          HexColor('#EFEFEF'),
                                                      enabledBorder:
                                                          OutlineInputBorder(
                                                              borderSide: BorderSide(
                                                                  color: Color(
                                                                      0x00FF0000)),
                                                              borderRadius:
                                                                  BorderRadius.all(
                                                                      Radius.circular(
                                                                          100))),
                                                      hintText: 'Password',
                                                      focusedBorder: OutlineInputBorder(
                                                          borderSide: BorderSide(
                                                              color: Color(
                                                                  0x00000000)),
                                                          borderRadius:
                                                              BorderRadius.all(
                                                                  Radius.circular(
                                                                      100))),
                                                      suffixIcon:
                                                          _pwdController.text != ''
                                                              ? GestureDetector(
                                                                  onTap: () =>
                                                                      setState(() =>
                                                                          pwdSwitch =
                                                                              !pwdSwitch),
                                                                  child: Icon(
                                                                      Icons
                                                                          .remove_red_eye,
                                                                      size:
                                                                          duSetHeight(
                                                                              20),
                                                                      color: pwdSwitch
                                                                          ? Colors
                                                                              .blueAccent
                                                                          : Colors
                                                                              .blueGrey
                                                                              .withOpacity(
                                                                                  .5)),
                                                                )
                                                              : SizedBox()),
                                                  obscureText: !pwdSwitch,
                                                ),
                                                SizedBox(height: duSetHeight(10)),
                                                Row(
                                                    mainAxisAlignment:
                                                        MainAxisAlignment.end,
                                                    children: <Widget>[
                                                      Padding(
                                                          padding:
                                                              EdgeInsets.symmetric(
                                                                  horizontal: 10),
                                                          child: RichText(
                                                              textAlign:
                                                                  TextAlign.right,
                                                              text: TextSpan(
                                                                  text:
                                                                      "Forgot password? ",
                                                                  style: TextStyle(
                                                                    fontSize: 15,
                                                                    fontWeight:
                                                                        FontWeight
                                                                            .w500,
                                                                    color: Colors
                                                                        .blueAccent,
                                                                  ),
                                                                  recognizer:
                                                                      TapGestureRecognizer()
                                                                        ..onTap =
                                                                            () async {
                                                                          //NavUtil.push()
                                                                        })))
                                                    ]),
                                                SizedBox(height: duSetHeight(20)),
                                                Container(
                                                    width: duSetWidth(150),
                                                    height: 50,
                                                    child: FlatButton(
                                                      colorBrightness:
                                                          Brightness.dark,
                                                      shape: RoundedRectangleBorder(
                                                          borderRadius:
                                                              BorderRadius.circular(
                                                                  25.0)),
                                                      onPressed: () {},
                                                      child: Text("Login",
                                                          style: TextStyle(
                                                              fontSize:
                                                                  duSetFontSize(15),
                                                              fontWeight:
                                                                  FontWeight.w500,
                                                              color: Colors.white)),
                                                      color: Colors.blueAccent,
                                                    )),
                                                SizedBox(height: duSetHeight(20))
                                              ]))
                                    ])))
                      ]),
                  Center(
                      child: Padding(
                          padding: EdgeInsets.only(top: duSetHeight(100)),
                          child: Container(
                              width: 100,
                              height: 100,
                              decoration: BoxDecoration(
                                  shape: BoxShape.circle,
                                  color: Colors.white,
                                  boxShadow: <BoxShadow>[
                                    BoxShadow(
                                        color: Colors.grey.withOpacity(0.6),
                                        offset: const Offset(2.0, 4.0),
                                        blurRadius: 8.0)
                                  ]),
                              child: ClipRRect(
                                  borderRadius: const BorderRadius.all(
                                      (Radius.circular(75.0))),
                                  child: Image.asset('assets/daniel.jpg')))))
                ]))));
      }
    }
    
    double duSetWidth(double width) {
      return ScreenUtil().setWidth(width);
    }
    
    double duSetHeight(double height) {
      return ScreenUtil().setHeight(height);
    }
    
    double duSetFontSize(double fontSize) {
      return ScreenUtil().setSp(fontSize);
    }
    
    class HexColor extends Color {
      HexColor(final String hexColor) : super(_getColorFromHex(hexColor));
    
      static int _getColorFromHex(String hexColor) {
        hexColor = hexColor.toUpperCase().replaceAll('#', '');
        if (hexColor.length == 6) {
          hexColor = 'FF' + hexColor;
        }
        return int.parse(hexColor, radix: 16);
      }
    }
    

    The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

    WhatsApp
    Facebook
    Google+
    Pinterest
    Telegram
    Twitter
    ReddIt
    Email
    Print
    Tumblr
    StumbleUpon
    VK
    Digg
    LINE
    Viber
      Previous articleGetX Important Points In Flutter
      Next articleCustom Popup Below The Widget In Flutter
      admin

      RELATED ARTICLESMORE FROM AUTHOR

      get storage flutter

      get storage flutter

      GlobalKey in Flutter

      GlobalKey in Flutter

      GroupBy in Flutter

      GroupBy in Flutter

      Search

      Subscribe to get letest updates

      ABOUT US
      www.fluttertutorial.in is the website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin Etc...with the help of this languages that help you to develop the beautiful mobile application.
      • Privacy Policy
      • Contact Us
      • About Us
      © Copyright 2019 - www.fluttertutorial.in
      MORE STORIES
      get storage flutter

      get storage flutter

      December 22, 2020
      GlobalKey in Flutter

      GlobalKey in Flutter

      December 17, 2020
      GroupBy in Flutter

      GroupBy in Flutter

      December 11, 2020
      Edit with Live CSS
      Save
      Write CSS OR LESS and hit save. CTRL + SPACE for auto-complete.