Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
8f0fd636
Commit
8f0fd636
authored
Feb 12, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typography demo
parent
adc22a38
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
1 deletion
+72
-1
typography_demo.dart
examples/material_gallery/lib/demo/typography_demo.dart
+69
-0
home.dart
examples/material_gallery/lib/gallery/home.dart
+3
-1
No files found.
examples/material_gallery/lib/demo/typography_demo.dart
0 → 100644
View file @
8f0fd636
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
class
TextStyleItem
extends
StatelessComponent
{
TextStyleItem
({
Key
key
,
this
.
name
,
this
.
style
,
this
.
text
})
:
super
(
key:
key
)
{
assert
(
name
!=
null
);
assert
(
style
!=
null
);
assert
(
text
!=
null
);
}
final
String
name
;
final
TextStyle
style
;
final
String
text
;
Widget
build
(
BuildContext
context
)
{
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
TextStyle
nameStyle
=
theme
.
text
.
body1
.
copyWith
(
color:
theme
.
text
.
caption
.
color
);
return
new
Padding
(
padding:
const
EdgeDims
.
symmetric
(
horizontal:
8.0
,
vertical:
16.0
),
child:
new
Row
(
alignItems:
FlexAlignItems
.
start
,
children:
<
Widget
>[
new
SizedBox
(
width:
64.0
,
child:
new
Text
(
name
,
style:
nameStyle
)
),
new
Flexible
(
child:
new
Text
(
text
,
style:
style
)
)
]
)
);
}
}
class
TypographyDemo
extends
StatelessComponent
{
Widget
build
(
BuildContext
context
)
{
final
TextTheme
textTheme
=
Theme
.
of
(
context
).
text
;
final
List
<
Widget
>
styleItems
=
<
Widget
>[
new
TextStyleItem
(
name:
'display3'
,
style:
textTheme
.
display3
,
text:
'Regular 56sp'
),
new
TextStyleItem
(
name:
'display2'
,
style:
textTheme
.
display2
,
text:
'Regular 45sp'
),
new
TextStyleItem
(
name:
'display1'
,
style:
textTheme
.
display1
,
text:
'Regular 34sp'
),
new
TextStyleItem
(
name:
'headline'
,
style:
textTheme
.
headline
,
text:
'Regular 24sp'
),
new
TextStyleItem
(
name:
'title'
,
style:
textTheme
.
title
,
text:
'Medium 20sp'
),
new
TextStyleItem
(
name:
'subhead'
,
style:
textTheme
.
subhead
,
text:
'Regular 16sp'
),
new
TextStyleItem
(
name:
'body2'
,
style:
textTheme
.
body2
,
text:
'Medium 14sp'
),
new
TextStyleItem
(
name:
'body1'
,
style:
textTheme
.
body1
,
text:
'Reguluar 14sp'
),
new
TextStyleItem
(
name:
'caption'
,
style:
textTheme
.
caption
,
text:
'Regular 12sp'
),
new
TextStyleItem
(
name:
'button'
,
style:
textTheme
.
button
,
text:
'MEDIUM (ALL CAPS) 14sp'
)
];
if
(
MediaQuery
.
of
(
context
).
size
.
width
>
500.0
)
{
styleItems
.
insert
(
0
,
new
TextStyleItem
(
name:
'display4'
,
style:
textTheme
.
display4
,
text:
'Light 112sp'
));
}
return
new
Scaffold
(
toolBar:
new
ToolBar
(
center:
new
Text
(
'Typography'
)),
body:
new
Block
(
children:
styleItems
)
);
}
}
examples/material_gallery/lib/gallery/home.dart
View file @
8f0fd636
...
...
@@ -28,6 +28,7 @@ import '../demo/tabs_demo.dart';
import
'../demo/tabs_fab_demo.dart'
;
import
'../demo/time_picker_demo.dart'
;
import
'../demo/two_level_list_demo.dart'
;
import
'../demo/typography_demo.dart'
;
import
'../demo/weathers_demo.dart'
;
class
GalleryHome
extends
StatefulComponent
{
...
...
@@ -72,7 +73,8 @@ class GalleryHomeState extends State<GalleryHome> {
image:
'assets/section_style.png'
,
colors:
Colors
.
green
,
demos:
<
GalleryDemo
>[
new
GalleryDemo
(
title:
'Colors'
,
builder:
()
=>
new
ColorsDemo
())
new
GalleryDemo
(
title:
'Colors'
,
builder:
()
=>
new
ColorsDemo
()),
new
GalleryDemo
(
title:
'Typography'
,
builder:
()
=>
new
TypographyDemo
())
]
)
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment