Overriding Theme Data in FLutter

Using copywith to override the theme data in flutter app developing. Sample code of flutter theme data with copywith properties.

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Listen English',
      theme: ThemeData.light().copyWith(
          primaryColor: Colors.lightBlue,
          scaffoldBackgroundColor: Colors.white),
      home: HomeScreen(),
    );
  }
}

About the Author: smartcoder

You might like

Leave a Reply

Your email address will not be published.