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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Muhammed Salih Güler
March 23, 2019
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
530
AWS Summit Stockholm - Amplify Studio
salihgueler
0
84
Serverlabs Flutter Talk
salihgueler
0
88
What is AWS Amplify - KotlinConf
salihgueler
0
120
Underengineering Contents: Creating Content For Everyone
salihgueler
0
57
How to prepare a proposal to conferences?
salihgueler
1
110
Flutter Study Jam Hannover
salihgueler
0
62
Write your first Flutter application
salihgueler
0
81
Mastering the Theming in Flutter
salihgueler
0
83
Other Decks in Programming
See All in Programming
JavaDoc 再入門
nagise
1
370
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.3k
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
Oxcを導入して開発体験が向上した話
yug1224
4
320
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.7k
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
110
OSもどきOS
arkw
0
570
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
180
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
570
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
270
Agentic UI
manfredsteyer
PRO
0
180
Featured
See All Featured
Bash Introduction
62gerente
615
220k
Statistics for Hackers
jakevdp
799
230k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
220
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
So, you think you're a good person
axbom
PRO
2
2.1k
Documentation Writing (for coders)
carmenintech
77
5.4k
Done Done
chrislema
186
16k
Are puppies a ranking factor?
jonoalderson
1
3.6k
Between Models and Reality
mayunak
4
340
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
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]