Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mastering the Theming in Flutter
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Muhammed Salih Güler
March 23, 2019
Programming
120
0
Share
Mastering the Theming in Flutter
Muhammed Salih Güler
March 23, 2019
More Decks by Muhammed Salih Güler
See All by Muhammed Salih Güler
Fluttercon 2023 - Flutter Talk
salihgueler
0
520
AWS Summit Stockholm - Amplify Studio
salihgueler
0
75
Serverlabs Flutter Talk
salihgueler
0
80
What is AWS Amplify - KotlinConf
salihgueler
0
120
Underengineering Contents: Creating Content For Everyone
salihgueler
0
51
How to prepare a proposal to conferences?
salihgueler
1
110
Flutter Study Jam Hannover
salihgueler
0
61
Write your first Flutter application
salihgueler
0
76
Mastering the Theming in Flutter
salihgueler
0
81
Other Decks in Programming
See All in Programming
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
310
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
450
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
4
1.3k
書き換えて学ぶTemporal #fukts
pirosikick
1
290
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
280
2026年のソフトウェア開発を考える(2026/05版) / Software Engineering Scrum Fest Niigata 2026 Edition
twada
PRO
18
5.8k
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
130
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
140
ハーネスエンジニアリングとは?
kinopeee
13
6.5k
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.8k
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
250
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
140
Featured
See All Featured
The Language of Interfaces
destraynor
162
26k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
230
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
110
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
210
The untapped power of vector embeddings
frankvandijk
2
1.7k
Balancing Empowerment & Direction
lara
6
1.1k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Transcript
Mastering the Theming in Flutter Muhammed Salih Guler @salihgueler 23.03.2019
About Me • Android Engineer @ • Flutter and Dart
GDE • Flutter Berlin Organiser
Theming • A theme describes the colors and typographic choices
of an application. • It’s important to establish a general language between your designer and developer
Theming contd. • A primary color is the color displayed
most frequently across your app’s screens and components. • A secondary color provides more ways to accent and distinguish your product.
What is Flutter? • Google’s Mobile Development SDK • Open
Source • One codebase for multiple platform • Written with Dart • Performant UX • Hot Reload
Theming in Flutter
None
Theming • Uses Theme widget • Applies a theme to
descendant widgets. • It can be implemented in 2 ways ◦ App-wide ◦ Widget
Creating Themes
theme.dart const Theme({ Key key, @required this.data, this.isMaterialAppTheme = false,
@required this.child, })
main.dart Theme( // Create a unique theme with "ThemeData" data:
ThemeData( accentColor: Colors.yellow, ), child: FloatingActionButton( onPressed: _incrementCounter, child: Icon(Icons.add), ), );
main.dart Theme( // Create a unique theme with "ThemeData" data:
ThemeData( accentColor: Colors.yellow, ), child: FloatingActionButton( onPressed: _incrementCounter, child: Icon(Icons.add), ), );
None
main.dart void main() => runApp(MyApp());
main.dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context)
{ return MaterialApp( theme: ThemeData( primarySwatch: Colors.deepOrange, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } }
app.dart return AnimatedTheme( data: theme, isMaterialAppTheme: true, child: widget.builder !=
null ? Builder( builder: (BuildContext context) { return widget.builder(context, child); }, ) : child, );
None
ThemeData • Holds the color and typography values for a
material design theme. • Used to configure a Theme widget.
ThemeData contd. • Brightness ◦ Dark ◦ Light
main.dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context)
{ return MaterialApp( theme: ThemeData( brightness: Brightness.dark ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } }
None
ThemeData contd. • Primary color pallette ◦ primarySwatch
main.dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context)
{ return MaterialApp( theme: ThemeData( primarySwatch: Colors.deepOrange, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } }
None
ThemeData contd. • Accent color ◦ accentColor or secondary color
main.dart class MyApp extends StatelessWidget { @override Widget build(BuildContext context)
{ return MaterialApp( theme: ThemeData( accentColor: Colors.deepOrange, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } }
None
ThemeData contd. • Colors and it’s brightness • Fonts •
Icon themes • Individual themes for screen components • Cupertino theming
Advanced Theming in Flutter (Okay not so much)
Adding a Font • Download the file from a provider
(Google Fonts) • Add it to pubspec.yaml
regular 400 regular 400 Italic medium 500 medium 500 Italic
semi-bold 600 semi-bold 600 Italic bold 700 bold 700 Italic extra-bold 800 extra-bold 800 Italic black 900 black 900 Italic Font weights
pubspec.yaml fonts: - family: Raleway fonts: - asset: assets/fonts/Raleway-Medium.ttf -
asset: assets/fonts/Raleway-MediumItalic.ttf style: italic - asset: assets/fonts/Raleway-Bold.ttf weight: 700
main.dart ThemeData( primaryColor: Colors.deepOrange, accentColor: Colors.deepPurple, fontFamily: 'Raleway' )
main.dart Text( '$_counter', style: Theme.of(context).textTheme.display1.copyWith(fontWeigh t: FontWeight.w700), )
None
main.dart const TextTheme({ this.display4, this.display3, this.display2, this.display1, this.headline, this.title, ...
this.subhead, this.body2, this.body1, this.caption, this.button, this.subtitle, this.overline, });
styles_example.dart class BrandColors { // Color palette static const mainTextColor
= const Color(0xff000000); }
styles_example.dart class CustomStyles { // Text styles static const customTextStyle
= const TextStyle( color: BrandColors.mainTextColor, fontFamily: "Raleway", fontStyle: FontStyle.italic, fontSize: 32.0 ); }
styles_example.dart Text( 'You have pushed the button this many times:',
style: CustomStyles.customTextStyle, textAlign: TextAlign.center, ),
None
What to do next? Codelabs: • MDC 101 in Flutter
Read: • Flutter theme documentation • Material Design website
Thank You! • Twitter: @salihgueler • GitHub: @salihgueler • Medium:
@muhammedsalihguler • E-mail:
[email protected]