user11428157
user11428157

Reputation:

The function 'Sizedbox' isn't defined

The function 'Sizedbox' isn't defined. [![enter image description here][1]][1] WANT TO KNOW HOW TO DEFINE FUNCTION PROPERLY WITHOUT ERRORS.0 I am new to flutter and I am learning flutter from youtube I'm trying to create a login UI in android studio. but I'm stuck with this error for a long time. can anyone please help

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import'package:flutter/services.dart';


class LoginScreen extends StatefulWidget {


@override
  _LoginScreenState createState() => _LoginScreenState();
  }

Widget buildEmail(){
  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: <Widget>[
      Text(
        'Email',
        style: TextStyle(
          color: Colors.white,
          fontSize: 16,
          fontWeight: FontWeight.bold

        ),
      ),

     Sizedbox (height:10),
      Container(
        alignment: Alignment.centerLeft,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(10),
          boxShadow: [
            BoxShadow(
              color:Colors.black26,
              blurRadius: 6,
              offset :Offset(0,2)

            )
          ]

        ),
        height:60,
        child: TextField(
          keyboardType: TextInputType.emailAddress,

        )


      )
    ]

  );
}





         class _LoginScreenState extends State <LoginScreen> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: AnnotatedRegion<SystemUiOverlayStyle> (
        value: SystemUiOverlayStyle.light,
        child: GestureDetector(
          child: Stack(
            children: <Widget>[
              Container(
                height: double.infinity,
                width: double.infinity,
                decoration: BoxDecoration(
                  gradient: LinearGradient(
                    begin: Alignment.topCenter,
                    end: Alignment.bottomCenter,
                    colors:[
                      Color(0x665ac18e),
                      Color(0x995ac18e),
                      Color(0xcc5ac18e),
                      Color(0xff5ac18e),
                    ]
                  )
                ),

                child:Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    Text(
                      'Sign In',
                      style: TextStyle(
                            color: Colors.white,
                        fontSize: 40,
                        fontWeight: FontWeight.bold

                      ),
                    ),

                    SizedBox(height: 50),
                    buildEmail(),

                  ],
                )
              )
            ],
          ),
        ),
      ),
    );
  }
}

Upvotes: 2

Views: 979

Answers (1)

Vishal_VE
Vishal_VE

Reputation: 2137

I check your code you used Sizedbox(height:10),in line no-17 it is SizedBox(height:10);Box word will be capitalize and other things work properly, This will work for you Thankyou

Upvotes: 2

Related Questions