skip to Main Content

It worked before, but now it gives this error. What can I do?

class HomeScreen extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Scaffold(

appBar: AppBar(
      backgroundColor: Colors.blue,
      title: Text("SHOP 1!"), // обернуть в padding и задать местоположение

    ),
    body:
    (

    child: Column(
      children: [
        Center(
            child: Padding(
              padding: const EdgeInsets.only(left: 0.0),
              child: ElevatedButton.icon(
                onPressed: () {},
                icon: Icon(
                  Icons.account_circle_rounded,
                  size: 24.0,


                ),
                label: Text('Личный кабинет'),
              ),

            )
        )],
    ),
    )



);

}

}

2

Answers


  1. The open paren right after body is causing this. Delete that and the closing paren on the line by itself before the line with a closing paren and a semicolon.

    You are actually accidentally using the new "records" feature of Dart 3.0. https://dart.dev/language/records

    Login or Signup to reply.
  2. I assume u miss or delete the Container Widget or any other Widget inside the body.

    body:
        Container(    
        child: Column(
          children: [
            Center(
                child: Padding(
                  padding: const EdgeInsets.only(left: 0.0),
                  child: ElevatedButton.icon(
                    onPressed: () {},
                    icon: Icon(
                      Icons.account_circle_rounded,
                      size: 24.0,  
    
                    ),
                    label: Text('Личный кабинет'),
                  ),    
                )
            )],
        ),
        )
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search