I had the same issue and the problem was I had called the class inside the same class. See the body: below. Replacing it with another widget fixed the issue.
class DicePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.red,
appBar: AppBar(
title: Text('Dicee'),
backgroundColor: Colors.red,
),
body: DicePage(),
),
);
}
}