Search code examples
flutterdartmobile-application

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


I am trying to apply an uniform theme of background color to my app but it is giving this error and I am not able to resolve it. This is the link to the error image.


Solution

  • Try adding scaffold to the container on the second page

         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(
           ),