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.
CodePudding user response:
Remove const from material app
MaterialApp(
home: MyAppBarWidget(),
theme: ThemeData(brightness: Brightness.dark, primaryColor: Colors.white),
);
CodePudding user response:
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(
),