我试图为整个应用程序提供一个单一的统一主题,但它给出了错误

I am trying to provide a single uniform theme to the whole app, but it is giving error

我正在尝试将背景颜色的统一主题应用到我的应用程序,但出现此错误且我无法解决。 This is the link to the error image.

从 material 应用中删除 const

 MaterialApp(
      home: MyAppBarWidget(),
      theme: ThemeData(brightness: Brightness.dark, primaryColor: Colors.white),
    );

尝试在第二页的容器中添加脚手架

     import 'package:flutter/material.dart';
     import 'package:flutter/services.dart'

     void main() => runApp(MaterialApp(
    theme: ThemeData( brightness: Brightness.light,
         primaryColor: Colors.white,
         scaffoldBackgroundColor: Colors.white,),
     home: Scaffold(
         backgroundColor: Colors.white,
         body: Application(),
     ),
     ));
      class Application extends StatelessWidget {
      const Application({Key? key}) : super(key: key);
       @override
       Widget build(BuildContext context) {
       return Scaffold(body:
       Container(
       ),