skip to Main Content

I am trying to create a sign-up UI like below:

enter image description here

Below is my developed UI:

enter image description here

My Code:

@override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Column(
          children: [
            SizedBox(
              width: MediaQuery.of(context).size.width,
              height: MediaQuery.of(context).size.height,
              child: Stack(children: <Widget>[
                Positioned(
                    child: Container(
                      width: MediaQuery.of(context).size.width,
                      height: MediaQuery.of(context).size.height * 0.4,
                      color: const Color(0xff32394a),
                      child: Center(
                          child: MaterialButton(
                              onPressed: () {},
                              child: const Text(
                                'AppName',
                                style: TextStyle(
                                    fontSize: 40,
                                    fontWeight: FontWeight.bold,
                                    color: Colors.white
                                ),
                              ))),
                    )),
                Positioned(
                    top: MediaQuery.of(context).size.height * 0.4 - 100,
                    left: 32,
                    right: 32,
                    child: Column(
                      children: [
                        Container(
                          width: MediaQuery.of(context).size.width - 64,
                          decoration: BoxDecoration(
                            color: const Color(0xffFFFFFF),
                            borderRadius: BorderRadius.circular(20),
                            border: Border.all(
                              color: const Color(0xffe8e8e8),  // Set the border color here
                              width: 2.0,        // Set the border width
                            ),
                          ),
                          padding: const EdgeInsets.all(32),
                          child: Column(
                            children: [
                              Container(
                                margin: const EdgeInsets.only(bottom: 32),
                                child: const Text(
                                  'Sign Up',
                                  style: TextStyle(
                                    fontSize: 24,
                                    fontWeight: FontWeight.bold,
                                  ),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 16),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(
                                          borderRadius:
                                          BorderRadius.circular(16)),
                                      hintText: 'Full Name',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      contentPadding: const EdgeInsets.only(
                                          left: 16,
                                          right: 16,
                                          top: 8,
                                          bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 16),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(
                                          borderRadius:
                                          BorderRadius.circular(16)),
                                      hintText: 'Email',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      contentPadding: const EdgeInsets.only(
                                          left: 16,
                                          right: 16,
                                          top: 8,
                                          bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 16),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  keyboardType: TextInputType.phone,
                                  maxLength: 10,
                                  maxLengthEnforcement: MaxLengthEnforcement.enforced,
                                  decoration: InputDecoration(
                                      prefixIcon: Icon(Icons.arrow_drop_down),
                                      labelText: '+1',
                                      suffixIconColor: const Color(0x9932394a),
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(
                                          borderRadius:
                                          BorderRadius.circular(16)),
                                      hintText: 'Phone Number',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      contentPadding: const EdgeInsets.only(
                                          left: 16,
                                          right: 16,
                                          top: 8,
                                          bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 16),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(
                                          borderRadius:
                                          BorderRadius.circular(16)),
                                      hintText: 'Username',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      contentPadding: const EdgeInsets.only(
                                          left: 16,
                                          right: 16,
                                          top: 8,
                                          bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 20),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  controller: password_textfield,
                                  obscureText: !_passwordVisible,
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(
                                          borderRadius:
                                          BorderRadius.circular(16)),
                                      hintText: 'Password',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      suffixIcon: IconButton(
                                        icon: Icon(
                                          // Based on passwordVisible state choose the icon
                                          _passwordVisible
                                              ? Icons.visibility
                                              : Icons.visibility_off,
                                          color: const Color(0x9932394a),
                                        ),
                                        onPressed: () {
                                          // Update the state i.e. toogle the state of passwordVisible variable
                                          setState(() {
                                            _passwordVisible = !_passwordVisible;
                                          });
                                        },
                                      ),
                                      contentPadding: const EdgeInsets.only(
                                          left: 16,
                                          right: 16,
                                          top: 8,
                                          bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 20),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  controller: confirm_password_textfield,
                                  obscureText: !_confirmpasswordVisible,
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(
                                          borderRadius:
                                          BorderRadius.circular(16)),
                                      hintText: 'Confirm Password',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      suffixIcon: IconButton(
                                        icon: Icon(
                                          // Based on passwordVisible state choose the icon
                                          _confirmpasswordVisible
                                              ? Icons.visibility
                                              : Icons.visibility_off,
                                          color: const Color(0x9932394a),
                                        ),
                                        onPressed: () {
                                          // Update the state i.e. toogle the state of passwordVisible variable
                                          setState(() {
                                            _confirmpasswordVisible = !_confirmpasswordVisible;
                                          });
                                        },
                                      ),
                                      contentPadding: const EdgeInsets.only(
                                          left: 16,
                                          right: 16,
                                          top: 8,
                                          bottom: 8)),
                                ),
                              ),
                              Row(

                                mainAxisSize: MainAxisSize.max,
                                children: [
                                  Expanded(
                                    child: ElevatedButton(
                                      onPressed: () {
                                        StartRegistration();
                                      },
                                      style: ElevatedButton.styleFrom(
                                        backgroundColor: const Color(0x9932394a),
                                        minimumSize: Size(double.infinity, 50),
                                        textStyle: TextStyle(
                                            fontWeight: FontWeight.bold,
                                            fontSize: 18
                                        ),
                                        shape: RoundedRectangleBorder(
                                          borderRadius: BorderRadius.circular(20), // Adjust the value as per your requirement
                                        ),
                                      ),
                                      child: const Text("Register",
                                          style: TextStyle(
                                            color: Colors.white,
                                          )),
                                    ),
                                  ),
                                ],
                              ),
                              const SizedBox(
                                height: 25,
                              ),
                            ],
                          ),
                        ),
                        Container(
                          margin: const EdgeInsets.only(top: 32),
                          child: TextButton(
                            onPressed: () async{
                              Navigator.of(context).pop();
                            },
                            child: RichText(
                              text: TextSpan(
                                children: <TextSpan>[
                                  TextSpan(
                                    text: "Back to",
                                    style: TextStyle(color: Colors.black, fontSize: 15.0),
                                  ),
                                  TextSpan(
                                    text: ' Sign In',
                                    style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 15.0),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        )
                      ],
                    )),
              ]),
            ),
          ],
        ),
      ),
    );
  }

I am facing 2 issues:

  1. I need to move the "AppName" text to top then lift the sign up box to top and make visible the "Back to Sign In" text.
  2. Also I need to add a box for the phone number pin code like the top image. Hint text also I need to show initially, currently after highlighting the TextField only it is visible.

3

Answers


  1.    final confirm_password_textfield = TextEditingController();
      final password_textfield = TextEditingController();
    
      bool _passwordVisible = false;
      bool _confirmpasswordVisible = false;
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: SingleChildScrollView(
            child: Stack(
              clipBehavior: Clip.none,
              children: [
                Container(
                  width: MediaQuery.of(context).size.width,
                  height: MediaQuery.of(context).size.height * 0.4,
                  color: const Color(0xff32394a),
                  child: const Column(
                    children: [
                      Padding(
                        padding: EdgeInsets.only(top: 55, left: 20),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Icon(
                              Icons.arrow_back_ios_new_outlined,
                              color: Colors.white,
                            ),
                            Text(
                              'AppName',
                              style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold, color: Colors.white),
                            ),
                            SizedBox(
                              width: 10,
                              height: 10,
                            )
                          ],
                        ),
                      ),
                    ],
                  ),
                ),
                Positioned(
                    top: MediaQuery.of(context).size.height * 0.25 - 100,
                    left: 32,
                    right: 32,
                    child: Column(
                      children: [
                        Container(
                          width: MediaQuery.of(context).size.width - 64,
                          decoration: BoxDecoration(
                            color: const Color(0xffFFFFFF),
                            borderRadius: BorderRadius.circular(20),
                            border: Border.all(
                              color: const Color(0xffe8e8e8), // Set the border color here
                              width: 2.0, // Set the border width
                            ),
                          ),
                          padding: const EdgeInsets.all(32),
                          child: Column(
                            children: [
                              Container(
                                margin: const EdgeInsets.only(bottom: 32),
                                child: const Text(
                                  'Sign Up',
                                  style: TextStyle(
                                    fontSize: 24,
                                    fontWeight: FontWeight.bold,
                                  ),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 16),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
                                      hintText: 'Full Name',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      contentPadding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 16),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
                                      hintText: 'Email',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      contentPadding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 16),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  keyboardType: TextInputType.phone,
                                  maxLength: 10,
                                  maxLengthEnforcement: MaxLengthEnforcement.enforced,
                                  decoration: InputDecoration(
                                      prefixIcon: Container(
                                        padding: EdgeInsets.only(left: 10),
                                        margin: EdgeInsets.all(10),
                                        height: 10,
                                        width: 65,
                                        decoration: BoxDecoration(
                                          borderRadius: BorderRadius.circular(8),
                                          color: Colors.grey.withOpacity(0.10),
                                          border: Border.all(
                                            color: Colors.black,
                                          )
                                        ),
                                        child: Row(
                                          children: [
                                            Text("+1"),
                                            Icon(Icons.arrow_drop_down),
                                          ],
                                        ),
                                      ),
                                      suffixIconColor: const Color(0x9932394a),
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
                                      hintText: 'Phone Number',
                                      counterText: "",
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      contentPadding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 16),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
                                      hintText: 'Username',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      contentPadding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 20),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  controller: password_textfield,
                                  obscureText: !_passwordVisible,
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
                                      hintText: 'Password',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      suffixIcon: IconButton(
                                        icon: Icon(
                                          // Based on passwordVisible state choose the icon
                                          _passwordVisible ? Icons.visibility : Icons.visibility_off,
                                          color: const Color(0x9932394a),
                                        ),
                                        onPressed: () {
                                          // Update the state i.e. toogle the state of passwordVisible variable
                                          setState(() {
                                            _passwordVisible = !_passwordVisible;
                                          });
                                        },
                                      ),
                                      contentPadding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8)),
                                ),
                              ),
                              Container(
                                margin: const EdgeInsets.only(bottom: 20),
                                child: TextField(
                                  cursorColor: const Color(0x9932394a),
                                  controller: confirm_password_textfield,
                                  obscureText: !_confirmpasswordVisible,
                                  decoration: InputDecoration(
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: const Color(0x9932394a)),
                                        borderRadius: BorderRadius.circular(16),
                                      ),
                                      border: OutlineInputBorder(borderRadius: BorderRadius.circular(16)),
                                      hintText: 'Confirm Password',
                                      hintStyle: TextStyle(color: const Color(0x99d1d1d1)),
                                      suffixIcon: IconButton(
                                        icon: Icon(
                                          // Based on passwordVisible state choose the icon
                                          _confirmpasswordVisible ? Icons.visibility : Icons.visibility_off,
                                          color: const Color(0x9932394a),
                                        ),
                                        onPressed: () {
                                          // Update the state i.e. toogle the state of passwordVisible variable
                                          setState(() {
                                            _confirmpasswordVisible = !_confirmpasswordVisible;
                                          });
                                        },
                                      ),
                                      contentPadding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8)),
                                ),
                              ),
                              Row(
                                mainAxisSize: MainAxisSize.max,
                                children: [
                                  Expanded(
                                    child: ElevatedButton(
                                      onPressed: () {},
                                      style: ElevatedButton.styleFrom(
                                        backgroundColor: const Color(0x9932394a),
                                        minimumSize: Size(double.infinity, 50),
                                        textStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
                                        shape: RoundedRectangleBorder(
                                          borderRadius: BorderRadius.circular(20), // Adjust the value as per your requirement
                                        ),
                                      ),
                                      child: const Text("Register",
                                          style: TextStyle(
                                            color: Colors.white,
                                          )),
                                    ),
                                  ),
                                ],
                              ),
                              const SizedBox(
                                height: 25,
                              ),
                            ],
                          ),
                        ),
                        Container(
                          margin: const EdgeInsets.only(top: 32),
                          child: TextButton(
                            onPressed: () async {
                              Navigator.of(context).pop();
                            },
                            child: RichText(
                              text: TextSpan(
                                children: <TextSpan>[
                                  TextSpan(
                                    text: "Back to",
                                    style: TextStyle(color: Colors.black, fontSize: 15.0),
                                  ),
                                  TextSpan(
                                    text: ' Sign In',
                                    style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 15.0),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        )
                      ],
                    )),
              ],
            ),
          ),
        );
      }
    

    Try this code

    Login or Signup to reply.
  2. Kk web’s code with some slight changes:

      final TextEditingController confirmPassController = TextEditingController();
      final TextEditingController passController = TextEditingController();
    
      final TextEditingController phoneController = TextEditingController();
    
      bool _showPass = false;
      bool _showConfirmPass = false;
    
      @override
      Widget build(BuildContext context) {
        double height = MediaQuery.of(context).size.height;
        double width = MediaQuery.of(context).size.width;
    
        return Scaffold(
          appBar: AppBar(
            backgroundColor: const Color(0xff32394a),
            centerTitle: true,
            title: const Text("AppName"),
            titleTextStyle:
                const TextStyle(fontSize: 26, fontWeight: FontWeight.w500),
          ),
          body: SingleChildScrollView(
            child: Stack(
              clipBehavior: Clip.none,
              children: [
                Container(
                  width: width,
                  height: height * .30,
                  color: const Color(0xff32394a),
                ),
                Center(
                  child: Column(
                    children: [
                      Container(
                        margin: const EdgeInsets.only(top: kToolbarHeight / 3),
                        width: MediaQuery.of(context).size.width * .85,
                        decoration: BoxDecoration(
                          color: const Color(0xffFFFFFF),
                          borderRadius: BorderRadius.circular(20),
                          border: Border.all(
                            color: const Color(0xffe8e8e8),
                            // Set the border color here
                            width: 2.0, // Set the border width
                          ),
                        ),
                        padding: const EdgeInsets.all(32),
                        child: Column(
                          children: [
                            Container(
                              margin: const EdgeInsets.only(bottom: 32),
                              child: const Text(
                                'Sign Up',
                                style: TextStyle(
                                  fontSize: 24,
                                  fontWeight: FontWeight.bold,
                                ),
                              ),
                            ),
                            Container(
                              margin: const EdgeInsets.only(bottom: 16),
                              child: TextField(
                                cursorColor: const Color(0x9932394a),
                                decoration: InputDecoration(
                                    focusedBorder: OutlineInputBorder(
                                      borderSide: const BorderSide(
                                          color: Color(0x9932394a)),
                                      borderRadius: BorderRadius.circular(16),
                                    ),
                                    border: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(16)),
                                    hintText: 'Full Name',
                                    hintStyle:
                                        const TextStyle(color: Color(0x99d1d1d1)),
                                    contentPadding: const EdgeInsets.only(
                                        left: 16, right: 16, top: 8, bottom: 8)),
                              ),
                            ),
                            Container(
                              margin: const EdgeInsets.only(bottom: 16),
                              child: TextField(
                                cursorColor: const Color(0x9932394a),
                                decoration: InputDecoration(
                                    focusedBorder: OutlineInputBorder(
                                      borderSide: const BorderSide(
                                          color: Color(0x9932394a)),
                                      borderRadius: BorderRadius.circular(16),
                                    ),
                                    border: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(16)),
                                    hintText: 'Email',
                                    hintStyle:
                                        const TextStyle(color: Color(0x99d1d1d1)),
                                    contentPadding: const EdgeInsets.only(
                                        left: 16, right: 16, top: 8, bottom: 8)),
                              ),
                            ),
                            Container(
                              margin: const EdgeInsets.only(bottom: 16),
                              child: TextField(
                                cursorColor: const Color(0x9932394a),
                                keyboardType: TextInputType.phone,
                                maxLength: 10,
                                controller: phoneController,
                                maxLengthEnforcement: MaxLengthEnforcement.enforced,
                                decoration: InputDecoration(
                                    prefixIcon: Container(
                                      padding: const EdgeInsets.only(left: 10),
                                      margin: const EdgeInsets.all(10),
                                      height: 10,
                                      width: 65,
                                      decoration: BoxDecoration(
                                          borderRadius: BorderRadius.circular(8),
                                          color: Colors.grey.withOpacity(0.10),
                                          border: Border.all(
                                            color: Colors.black,
                                          )),
                                      child: const Row(
                                        children: [
                                          Text("+1"),
                                          Icon(Icons.arrow_drop_down),
                                        ],
                                      ),
                                    ),
                                    suffixIconColor: const Color(0x9932394a),
                                    focusedBorder: OutlineInputBorder(
                                      borderSide: const BorderSide(
                                          color: Color(0x9932394a)),
                                      borderRadius: BorderRadius.circular(16),
                                    ),
                                    border: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(16)),
                                    hintText: 'Phone Number',
                                    counterText: "",
                                    hintStyle:
                                        const TextStyle(color: Color(0x99d1d1d1)),
                                    contentPadding: const EdgeInsets.only(
                                        left: 16, right: 16, top: 8, bottom: 8)),
                              ),
                            ),
                            Container(
                              margin: const EdgeInsets.only(bottom: 16),
                              child: TextField(
                                cursorColor: const Color(0x9932394a),
                                decoration: InputDecoration(
                                    focusedBorder: OutlineInputBorder(
                                      borderSide: const BorderSide(
                                          color: Color(0x9932394a)),
                                      borderRadius: BorderRadius.circular(16),
                                    ),
                                    border: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(16)),
                                    hintText: 'Username',
                                    hintStyle:
                                        const TextStyle(color: Color(0x99d1d1d1)),
                                    contentPadding: const EdgeInsets.only(
                                        left: 16, right: 16, top: 8, bottom: 8)),
                              ),
                            ),
                            Container(
                              margin: const EdgeInsets.only(bottom: 20),
                              child: TextField(
                                cursorColor: const Color(0x9932394a),
                                controller: passController,
                                obscureText: !_showPass,
                                decoration: InputDecoration(
                                    focusedBorder: OutlineInputBorder(
                                      borderSide: const BorderSide(
                                          color: Color(0x9932394a)),
                                      borderRadius: BorderRadius.circular(16),
                                    ),
                                    border: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(16)),
                                    hintText: 'Password',
                                    hintStyle:
                                        const TextStyle(color: Color(0x99d1d1d1)),
                                    suffixIcon: IconButton(
                                      icon: Icon(
                                        // Based on passwordVisible state choose the icon
                                        _showPass
                                            ? Icons.visibility
                                            : Icons.visibility_off,
                                        color: const Color(0x9932394a),
                                      ),
                                      onPressed: () {
                                        // Update the state i.e. toogle the state of passwordVisible variable
                                        setState(() {
                                          _showPass = !_showPass;
                                        });
                                      },
                                    ),
                                    contentPadding: const EdgeInsets.only(
                                        left: 16, right: 16, top: 8, bottom: 8)),
                              ),
                            ),
                            Container(
                              margin: const EdgeInsets.only(bottom: 20),
                              child: TextField(
                                cursorColor: const Color(0x9932394a),
                                controller: confirmPassController,
                                obscureText: !_showConfirmPass,
                                decoration: InputDecoration(
                                    focusedBorder: OutlineInputBorder(
                                      borderSide: const BorderSide(
                                          color: Color(0x9932394a)),
                                      borderRadius: BorderRadius.circular(16),
                                    ),
                                    border: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(16)),
                                    hintText: 'Confirm Password',
                                    hintStyle:
                                        const TextStyle(color: Color(0x99d1d1d1)),
                                    suffixIcon: IconButton(
                                      icon: Icon(
                                        // Based on passwordVisible state choose the icon
                                        _showConfirmPass
                                            ? Icons.visibility
                                            : Icons.visibility_off,
                                        color: const Color(0x9932394a),
                                      ),
                                      onPressed: () {
                                        // Update the state i.e. toogle the state of passwordVisible variable
                                        setState(() {
                                          _showConfirmPass =
                                              !_showConfirmPass;
                                        });
                                      },
                                    ),
                                    contentPadding: const EdgeInsets.only(
                                        left: 16, right: 16, top: 8, bottom: 8)),
                              ),
                            ),
                            MaterialButton(
                              onPressed: () {},
                              color: const Color(0xff32394a),
                              minWidth: width,
                              padding: const EdgeInsets.all(12.0),
                              shape: RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(30),
                              ),
                              child: const Text("Register",style: TextStyle(color: Colors.white,fontSize: 16),),
                            ),
                            const SizedBox(
                              height: 25,
                            ),
                          ],
                        ),
                      ),
                      Padding(
                        padding: const EdgeInsets.only(top: kToolbarHeight * .30),
                        child: TextButton(
                          onPressed: () async {
                            Navigator.of(context).pop();
                          },
                          child: RichText(
                            text: const TextSpan(
                              children: <TextSpan>[
                                TextSpan(
                                  text: "Back to",
                                  style: TextStyle(
                                      color: Colors.black, fontSize: 15.0),
                                ),
                                TextSpan(
                                  text: ' Sign In',
                                  style: TextStyle(
                                      fontWeight: FontWeight.bold,
                                      color: Colors.black,
                                      fontSize: 15.0),
                                ),
                              ],
                            ),
                          ),
                        ),
                      )
                    ],
                  ),
                ),
              ],
            ),
          ),
        );
      }
    

    DEMO

    Login or Signup to reply.
  3. You can achieve the result via below code

      @override
      Widget build(BuildContext context) {
        return Scaffold(
          resizeToAvoidBottomInset: false,
          body: Stack(
            children: <Widget>[
              Positioned(
                child: Column(
                  children: [
                    Container(
                      width: MediaQuery.of(context).size.width,
                      height: MediaQuery.of(context).size.height * 0.4,
                      color: const Color(0xff32394a),
                    ),
                    Container(
                      width: MediaQuery.of(context).size.width,
                      height: MediaQuery.of(context).size.height * 0.6,
                      color: const Color(0xffffffff),
                    ),
                  ],
                ),
              ),
              Positioned(
                top: 0,
                bottom: 0,
                right: 0,
                left: 0,
                child: SafeArea(
                  child: Column(
                    children: [
                      Container(
                        margin: EdgeInsets.only(top: 30),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Expanded(
                              child: Icon(
                                (Icons.arrow_back_ios),
                                color: Colors.white,
                              ),
                              flex: 1,
                            ),
                            Expanded(
                              child: Text(
                                'AppName',
                                style: TextStyle(
                                  fontSize: 40,
                                  fontWeight: FontWeight.bold,
                                  color: Colors.white,
                                ),
                                textAlign: TextAlign.center,
                              ),
                              flex: 4,
                            ),
                            Expanded(child: SizedBox())
                          ],
                        ),
                      ),
                      SizedBox(
                        height: 20,
                      ),
                      Expanded(
                        child: SingleChildScrollView(
    
                            physics: BouncingScrollPhysics(),
                            child: Container(
                              width: MediaQuery.of(context).size.width - 64,
    
                              decoration: BoxDecoration(
                                color: const Color(0xffFFFFFF),
                                borderRadius: BorderRadius.circular(20),
                                border: Border.all(
                                  color: const Color(0xffe8e8e8),
                                  // Set the border color here
                                  width: 2.0, // Set the border width
                                ),
                              ),
                              padding: const EdgeInsets.all(32),
                              child: Padding(
    
                                padding:   EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
                                child: Column(
                                  children: [
                                    Container(
                                      margin: const EdgeInsets.only(bottom: 32),
                                      child: const Text(
                                        'Sign Up',
                                        style: TextStyle(
                                          fontSize: 24,
                                          fontWeight: FontWeight.bold,
                                        ),
                                      ),
                                    ),
                                    Container(
                                      margin: const EdgeInsets.only(bottom: 16),
                                      child: TextField(
                                        cursorColor: const Color(0x9932394a),
                                        decoration: InputDecoration(
                                            focusedBorder: OutlineInputBorder(
                                              borderSide: BorderSide(
                                                  color: const Color(0x9932394a)),
                                              borderRadius:
                                                  BorderRadius.circular(16),
                                            ),
                                            border: OutlineInputBorder(
                                                borderRadius:
                                                    BorderRadius.circular(16)),
                                            hintText: 'Full Name',
                                            hintStyle: TextStyle(
                                                color: const Color(0x99d1d1d1)),
                                            contentPadding: const EdgeInsets.only(
                                                left: 16,
                                                right: 16,
                                                top: 8,
                                                bottom: 8)),
                                      ),
                                    ),
                                    Container(
                                      margin: const EdgeInsets.only(bottom: 16),
                                      child: TextField(
                                        cursorColor: const Color(0x9932394a),
                                        decoration: InputDecoration(
                                            focusedBorder: OutlineInputBorder(
                                              borderSide: BorderSide(
                                                  color: const Color(0x9932394a)),
                                              borderRadius:
                                                  BorderRadius.circular(16),
                                            ),
                                            border: OutlineInputBorder(
                                                borderRadius:
                                                    BorderRadius.circular(16)),
                                            hintText: 'Email',
                                            hintStyle: TextStyle(
                                                color: const Color(0x99d1d1d1)),
                                            contentPadding: const EdgeInsets.only(
                                                left: 16,
                                                right: 16,
                                                top: 8,
                                                bottom: 8)),
                                      ),
                                    ),
                                    Container(
                                      margin: const EdgeInsets.only(bottom: 16),
                                      child: TextField(
                                        cursorColor: const Color(0x9932394a),
                                        keyboardType: TextInputType.phone,
                                        maxLength: 10,
                                        maxLengthEnforcement:
                                            MaxLengthEnforcement.enforced,
                                        decoration: InputDecoration(
                                            prefixIcon: Container(
                                              padding: EdgeInsets.only(left: 10),
                                              margin: EdgeInsets.all(10),
                                              height: 10,
                                              width: 65,
                                              decoration: BoxDecoration(
                                                  borderRadius:
                                                      BorderRadius.circular(8),
                                                  color: Colors.grey
                                                      .withOpacity(0.10),
                                                  border: Border.all(
                                                    color: Colors.black,
                                                  )),
                                              child: Row(
                                                children: [
                                                  Text("+1"),
                                                  Icon(Icons.arrow_drop_down),
                                                ],
                                              ),
                                            ),
                                            suffixIconColor:
                                                const Color(0x9932394a),
                                            focusedBorder: OutlineInputBorder(
                                              borderSide: BorderSide(
                                                  color: const Color(0x9932394a)),
                                              borderRadius:
                                                  BorderRadius.circular(16),
                                            ),
                                            border: OutlineInputBorder(
                                                borderRadius:
                                                    BorderRadius.circular(16)),
                                            hintText: 'Phone Number',
                                            counterText: "",
                                            hintStyle: TextStyle(
                                                color: const Color(0x99d1d1d1)),
                                            contentPadding: const EdgeInsets.only(
                                                left: 16,
                                                right: 16,
                                                top: 8,
                                                bottom: 8)),
                                      ),
                                    ),
                                    Container(
                                      margin: const EdgeInsets.only(bottom: 16),
                                      child: TextField(
                                        cursorColor: const Color(0x9932394a),
                                        decoration: InputDecoration(
                                            focusedBorder: OutlineInputBorder(
                                              borderSide: BorderSide(
                                                  color: const Color(0x9932394a)),
                                              borderRadius:
                                                  BorderRadius.circular(16),
                                            ),
                                            border: OutlineInputBorder(
                                                borderRadius:
                                                    BorderRadius.circular(16)),
                                            hintText: 'Username',
                                            hintStyle: TextStyle(
                                                color: const Color(0x99d1d1d1)),
                                            contentPadding: const EdgeInsets.only(
                                                left: 16,
                                                right: 16,
                                                top: 8,
                                                bottom: 8)),
                                      ),
                                    ),
                                    Container(
                                      margin: const EdgeInsets.only(bottom: 20),
                                      child: TextField(
                                        cursorColor: const Color(0x9932394a),
                                        controller: password_textfield,
                                        obscureText: !_passwordVisible,
                                        decoration: InputDecoration(
                                            focusedBorder: OutlineInputBorder(
                                              borderSide: BorderSide(
                                                  color: const Color(0x9932394a)),
                                              borderRadius:
                                                  BorderRadius.circular(16),
                                            ),
                                            border: OutlineInputBorder(
                                                borderRadius:
                                                    BorderRadius.circular(16)),
                                            hintText: 'Password',
                                            hintStyle: TextStyle(
                                                color: const Color(0x99d1d1d1)),
                                            suffixIcon: IconButton(
                                              icon: Icon(
                                                // Based on passwordVisible state choose the icon
                                                _passwordVisible
                                                    ? Icons.visibility
                                                    : Icons.visibility_off,
                                                color: const Color(0x9932394a),
                                              ),
                                              onPressed: () {
                                                // Update the state i.e. toogle the state of passwordVisible variable
                                                setState(() {
                                                  _passwordVisible =
                                                      !_passwordVisible;
                                                });
                                              },
                                            ),
                                            contentPadding: const EdgeInsets.only(
                                                left: 16,
                                                right: 16,
                                                top: 8,
                                                bottom: 8)),
                                      ),
                                    ),
                                    Container(
                                      margin: const EdgeInsets.only(bottom: 20),
                                      child: TextField(
                                        cursorColor: const Color(0x9932394a),
                                        controller: confirm_password_textfield,
                                        obscureText: !_confirmpasswordVisible,
                                        decoration: InputDecoration(
                                            focusedBorder: OutlineInputBorder(
                                              borderSide: BorderSide(
                                                  color: const Color(0x9932394a)),
                                              borderRadius:
                                                  BorderRadius.circular(16),
                                            ),
                                            border: OutlineInputBorder(
                                                borderRadius:
                                                    BorderRadius.circular(16)),
                                            hintText: 'Confirm Password',
                                            hintStyle: TextStyle(
                                                color: const Color(0x99d1d1d1)),
                                            suffixIcon: IconButton(
                                              icon: Icon(
                                                // Based on passwordVisible state choose the icon
                                                _confirmpasswordVisible
                                                    ? Icons.visibility
                                                    : Icons.visibility_off,
                                                color: const Color(0x9932394a),
                                              ),
                                              onPressed: () {
                                                // Update the state i.e. toogle the state of passwordVisible variable
                                                setState(() {
                                                  _confirmpasswordVisible =
                                                      !_confirmpasswordVisible;
                                                });
                                              },
                                            ),
                                            contentPadding: const EdgeInsets.only(
                                                left: 16,
                                                right: 16,
                                                top: 8,
                                                bottom: 8)),
                                      ),
                                    ),
                                    Row(
                                      mainAxisSize: MainAxisSize.max,
                                      children: [
                                        Expanded(
                                          child: ElevatedButton(
                                            onPressed: () {},
                                            style: ElevatedButton.styleFrom(
                                              backgroundColor:
                                                  const Color(0x9932394a),
                                              minimumSize:
                                                  Size(double.infinity, 50),
                                              textStyle: TextStyle(
                                                  fontWeight: FontWeight.bold,
                                                  fontSize: 18),
                                              shape: RoundedRectangleBorder(
                                                borderRadius: BorderRadius.circular(
                                                    20), // Adjust the value as per your requirement
                                              ),
                                            ),
                                            child: const Text("Register",
                                                style: TextStyle(
                                                  color: Colors.white,
                                                )),
                                          ),
                                        ),
                                      ],
                                    ),
                                    const SizedBox(
                                      height: 25,
                                    ),
                                  ],
                                ),
                              ),
                            )),
                      ),
                
                      Container(
                        child: TextButton(
                          onPressed: () async {},
                          child: RichText(
                            text: TextSpan(
                              children: <TextSpan>[
                                TextSpan(
                                  text: "Back to",
                                  style: TextStyle(
                                      color: Colors.black, fontSize: 15.0),
                                ),
                                TextSpan(
                                  text: ' Sign In',
                                  style: TextStyle(
                                      fontWeight: FontWeight.bold,
                                      color: Colors.black,
                                      fontSize: 15.0),
                                ),
                              ],
                            ),
                          ),
                        ),
                      )
                    ],
                  ),
                ),
              ),
            ],
          ),
        );
      }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search