Home > database >  Flutter Login Screen
Flutter Login Screen

Time:07-30

   Padding(
                padding: const EdgeInsets.symmetric(horizontal: 25.0),
                child: Container(
                  decoration: BoxDecoration(
                    color: Colors.deepPurple
                    *border*: Border.all(color: Colors.white),
                    borderRadius: BorderRadius.circular(12),
                  ),
                  child: const Padding(
                    padding: EdgeInsets.only(left: 8.0),
                    child: TextField(
                      decoration: InputDecoration(
                        border: InputBorder.none,
                        hintText: 'E-mail adresinizi giriniz'
                      ),
                    ),
                  ),
                ),
              ),

I get this errors. Can someone help?

*Expected to find ','.

I know I should add ','. But where?

Underlined word marked

CodePudding user response:

It's telling you that by the time it reached border, it was expecting a ,.

The compiler / analyzer / linter won't always be able to tell you exactly where your issue is, but in this case it's pretty close (hint: the line before border).

I'd recommend getting in the habit of including the , at the end of ever line when you're splitting parameters over multiple lines, even when you don't need it (i.e. after the last parameter). For example, instead of

                      decoration: InputDecoration(
                        border: InputBorder.none,
                        hintText: 'E-mail adresinizi giriniz'
                      )

Do

                      decoration: InputDecoration(
                        border: InputBorder.none,
                        hintText: 'E-mail adresinizi giriniz',
                      )

That way it's easier to notice when it's missing, and if you add new parameters after it, you don't need to remember to add a , to it first.

CodePudding user response:

you should add the comma after this section color: Colors.deepPurple, inside BoxDecoration line number five.

  • Related