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
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
I assume u miss or delete the Container Widget or any other Widget inside the body.