The argument type 'IconData' can't be assigned to the parameter type 'Widget'
class _Homestart extends StatelessWidget {
@override Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.lightBlue,
body: Center(
child: Container(
child: Center(
child: Stack(
alignment:
Alignment.center,
children: <Widget>[
Positioned(
child: Container(
child: IconButton(
icon: Icons.add, onPressed: () { },
),
width: 200,
height: 100,
decoration: BoxDecoration(
color: Colors.tealAccent,
borderRadius: BorderRadius.circular(30)),
),
),
_Counter()
],
)),
)
/*
color: Colors.tealAccent,
width: 100,
height: 100,
*/
),
));
}
}
class _Counter extends StatefulWidget {
@override State<StatefulWidget> createState() {
// TODO: implement createState
return _CounterState();
}
}
class _CounterState extends State<_Counter> {
@override Widget build(BuildContext context) {
return Center(
child: Text(
"0",
style: TextStyle(fontSize: 65),
),
);
}
}
Нельзя использовать Icons.add c wiget?