My flutter app wont use materal desing 3 after adding useMaterial3:true in theme
I added the flag according to the the blog and material design website(flutter)
My flutter app wont use materal desing 3 after adding useMaterial3:true in theme
I added the flag according to the the blog and material design website(flutter)
try this code it should work fine . `
void main() {
runApp(
const MyApp(),
);
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(useMaterial3: true),
home: const HomePage(),
);
}
}
`
This code should work, try it..
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.light(useMaterial3: true),
body: MyHomePage(),
);
}
}