/
Introduction to Themes Introduction Introduction to Themes Introduction

Introduction to Themes Introduction - PowerPoint Presentation

natalie
natalie . @natalie
Follow
0 views
Uploaded On 2024-03-13

Introduction to Themes Introduction - PPT Presentation

Themes are an integral part of UI for any application Themes are used to design the fonts and colors of an application to make it more presentable In Flutter the Theme widget is used to add themes to an application ID: 1048152

application theme themes colors theme application colors themes part creating app parent child themedata unique context add section widget

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Introduction to Themes Introduction" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1. Introduction to Themes

2. IntroductionThemes are an integral part of UI for any application.Themes are used to design the fonts and colors of an application to make it more presentable. In Flutter, the Theme widget is used to add themes to an application. One can use it either for a particular part of the application like buttons and navigation bar or define it in the root of the application to use it throughout the entire app.

3. Creating a ThemeUse the Theme widget to create a theme.  In themes some of the properties that can be used are given below:TextThemebrightnessprimarycoloraccentColorfontFamily

4. Creating a ThemeMaterialApp(title: title,theme: ThemeData( brightness: Brightness.dark, primaryColor: Colors.lightBlue[800], accentColor: Colors.cyan[600], fontFamily: 'Georgia’, textTheme: TextTheme( headline1: TextStyle(fontSize: 72.0, fontWeight: FontWeight.bold), headline6: TextStyle(fontSize: 36.0, fontStyle: FontStyle.italic), bodyText2: TextStyle(fontSize: 14.0, fontFamily: 'Hind'), ),));

5. How to use itContainer(color: Theme.of(context).accentColor,child: Text( 'Hello Everyone!', style: Theme.of(context).textTheme.headline6,),);

6. Themes for part of an applicationTo override the app-wide theme in part of an application, wrap a section of the app in a Theme widgetThere are two ways to approach this:Creating a unique ThemeDataExtending the parent theme

7. Themes for part of an applicationTo override the app-wide theme in part of an application, wrap a section of the app in a Theme widgetThere are two ways to approach this:Creating a unique ThemeDataExtending the parent theme

8. Creating unique ThemeDataIf you don’t want to inherit any application colors or font styles, create a ThemeData() instance and pass that to the Theme widget.Theme( // Create a unique theme with `ThemeData` data: ThemeData( splashColor: Colors.yellow, ), child: FloatingActionButton( onPressed: () {}, child: const Icon(Icons.add), ),);

9. Extending the parent themeRather than overriding everything, it often makes sense to extend the parent theme. You can handle this by using the copyWith() method.Theme( // Find and extend the parent theme using `copyWith`. See the next // section for more info on `Theme.of`. data: Theme.of(context).copyWith(splashColor: Colors.yellow), child: const FloatingActionButton( onPressed: null, child: Icon(Icons.add), ),);

10.