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
ac0aed5a
Commit
ac0aed5a
authored
Dec 09, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #846 from abarth/text_decoration
Update to the new TextDecoration API
parents
dbf6149a
ab89d2e4
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
20 additions
and
64 deletions
+20
-64
main.dart
examples/mine_digger/lib/main.dart
+1
-1
card_collection.dart
examples/widgets/card_collection.dart
+1
-1
ensure_visible.dart
examples/widgets/ensure_visible.dart
+2
-2
indexed_stack.dart
examples/widgets/indexed_stack.dart
+1
-1
overlay_geometry.dart
examples/widgets/overlay_geometry.dart
+1
-1
pageable_list.dart
examples/widgets/pageable_list.dart
+1
-1
styled_text.dart
examples/widgets/styled_text.dart
+2
-2
material_app.dart
packages/flutter/lib/src/material/material_app.dart
+1
-1
typography.dart
packages/flutter/lib/src/material/typography.dart
+1
-1
text_style.dart
packages/flutter/lib/src/painting/text_style.dart
+4
-38
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+1
-6
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+1
-6
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+1
-1
pubspec.yaml
packages/flutter/pubspec.yaml
+2
-2
No files found.
examples/mine_digger/lib/main.dart
View file @
ac0aed5a
...
...
@@ -31,7 +31,7 @@ const List<Color> textColors = const <Color>[
];
final
List
<
TextStyle
>
textStyles
=
textColors
.
map
((
Color
color
)
{
return
new
TextStyle
(
color:
color
,
fontWeight:
bold
,
textAlign:
TextAlign
.
center
);
return
new
TextStyle
(
color:
color
,
fontWeight:
FontWeight
.
bold
,
textAlign:
TextAlign
.
center
);
}).
toList
();
enum
CellState
{
covered
,
exploded
,
cleared
,
flagged
,
shown
}
...
...
examples/widgets/card_collection.dart
View file @
ac0aed5a
...
...
@@ -26,7 +26,7 @@ class CardCollection extends StatefulComponent {
class
CardCollectionState
extends
State
<
CardCollection
>
{
static
const
TextStyle
cardLabelStyle
=
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
18.0
,
fontWeight:
bold
);
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
18.0
,
fontWeight:
FontWeight
.
bold
);
// TODO(hansmuller): need a local image asset
static
const
_sunshineURL
=
"http://www.walltor.com/images/wallpaper/good-morning-sunshine-58540.jpg"
;
...
...
examples/widgets/ensure_visible.dart
View file @
ac0aed5a
...
...
@@ -25,13 +25,13 @@ class TappableCard extends StatelessComponent {
static
const
TextStyle
cardLabelStyle
=
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
18.0
,
fontWeight:
bold
fontWeight:
FontWeight
.
bold
);
static
const
TextStyle
selectedCardLabelStyle
=
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
24.0
,
fontWeight:
bold
fontWeight:
FontWeight
.
bold
);
Widget
build
(
BuildContext
context
)
{
...
...
examples/widgets/indexed_stack.dart
View file @
ac0aed5a
...
...
@@ -20,7 +20,7 @@ class IndexedStackDemoState extends State<IndexedStackDemo> {
}
List
<
PopupMenuItem
>
_buildMenu
()
{
TextStyle
style
=
const
TextStyle
(
fontSize:
18.0
,
fontWeight:
bold
);
TextStyle
style
=
const
TextStyle
(
fontSize:
18.0
,
fontWeight:
FontWeight
.
bold
);
String
pad
=
''
;
return
new
List
<
PopupMenuItem
>.
generate
(
_itemCount
,
(
int
i
)
{
pad
+=
'-'
;
...
...
examples/widgets/overlay_geometry.dart
View file @
ac0aed5a
...
...
@@ -91,7 +91,7 @@ class OverlayGeometryApp extends StatefulComponent {
class
OverlayGeometryAppState
extends
State
<
OverlayGeometryApp
>
{
static
const
TextStyle
cardLabelStyle
=
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
18.0
,
fontWeight:
bold
);
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
18.0
,
fontWeight:
FontWeight
.
bold
);
List
<
CardModel
>
cardModels
;
Map
<
MarkerType
,
Point
>
markers
=
new
Map
<
MarkerType
,
Point
>();
...
...
examples/widgets/pageable_list.dart
View file @
ac0aed5a
...
...
@@ -34,7 +34,7 @@ class PageableListAppState extends State<PageableListApp> {
}
static
const
TextStyle
cardLabelStyle
=
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
18.0
,
fontWeight:
bold
);
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
18.0
,
fontWeight:
FontWeight
.
bold
);
List
<
CardModel
>
cardModels
;
Size
pageSize
=
new
Size
(
200.0
,
200.0
);
...
...
examples/widgets/styled_text.dart
View file @
ac0aed5a
...
...
@@ -39,9 +39,9 @@ HAL: This mission is too important for me to allow you to jeopardize it.''';
final
TextStyle
daveStyle
=
new
TextStyle
(
color:
Colors
.
indigo
[
400
],
height:
1.8
);
final
TextStyle
halStyle
=
new
TextStyle
(
color:
Colors
.
red
[
400
],
fontFamily:
"monospace"
);
final
TextStyle
boldStyle
=
const
TextStyle
(
fontWeight:
bold
);
final
TextStyle
boldStyle
=
const
TextStyle
(
fontWeight:
FontWeight
.
bold
);
final
TextStyle
underlineStyle
=
const
TextStyle
(
decoration:
underline
,
decoration:
TextDecoration
.
underline
,
decorationColor:
const
Color
(
0xFF000000
),
decorationStyle:
TextDecorationStyle
.
wavy
);
...
...
packages/flutter/lib/src/material/material_app.dart
View file @
ac0aed5a
...
...
@@ -18,7 +18,7 @@ const TextStyle _errorTextStyle = const TextStyle(
fontSize:
48.0
,
fontWeight:
FontWeight
.
w900
,
textAlign:
TextAlign
.
right
,
decoration:
underline
,
decoration:
TextDecoration
.
underline
,
decorationColor:
const
Color
(
0xFFFF00
),
decorationStyle:
TextDecorationStyle
.
double
);
...
...
packages/flutter/lib/src/material/typography.dart
View file @
ac0aed5a
...
...
@@ -71,7 +71,7 @@ class Typography {
fontSize:
48.0
,
fontWeight:
FontWeight
.
w900
,
textAlign:
TextAlign
.
right
,
decoration:
underline
,
decoration:
TextDecoration
.
underline
,
decorationColor:
const
Color
(
0xFFFF00
),
decorationStyle:
TextDecorationStyle
.
double
);
...
...
packages/flutter/lib/src/painting/text_style.dart
View file @
ac0aed5a
...
...
@@ -6,21 +6,6 @@ import 'dart:ui' as ui;
import
'basic_types.dart'
;
/// A normal font weight
const
normal
=
FontWeight
.
w400
;
/// A bold font weight
const
bold
=
FontWeight
.
w700
;
/// Draw a line underneath each line of text
const
underline
=
const
<
TextDecoration
>[
TextDecoration
.
underline
];
/// Draw a line above each line of text
const
overline
=
const
<
TextDecoration
>[
TextDecoration
.
overline
];
/// Draw a line through each line of text
const
lineThrough
=
const
<
TextDecoration
>[
TextDecoration
.
lineThrough
];
/// An immutable style in which paint text
class
TextStyle
{
const
TextStyle
({
...
...
@@ -70,8 +55,8 @@ class TextStyle {
/// The distance between the text baselines, as a multiple of the font size.
final
double
height
;
///
A list of
decorations to paint near the text.
final
List
<
TextDecoration
>
decoration
;
// TODO(ianh): Switch this to a Set<> once Dart supports constant Sets
///
The
decorations to paint near the text.
final
TextDecoration
decoration
;
/// The color in which to paint the text decorations.
final
Color
decorationColor
;
...
...
@@ -91,7 +76,7 @@ class TextStyle {
TextAlign
textAlign
,
TextBaseline
textBaseline
,
double
height
,
List
<
TextDecoration
>
decoration
,
TextDecoration
decoration
,
Color
decorationColor
,
TextDecorationStyle
decorationStyle
})
{
...
...
@@ -302,26 +287,7 @@ class TextStyle {
if
(
decoration
!=
null
)
{
if
(
haveDecorationDescription
)
decorationDescription
+=
' '
;
bool
multipleDecorations
=
false
;
for
(
TextDecoration
value
in
decoration
)
{
if
(
multipleDecorations
)
decorationDescription
+=
'+'
;
switch
(
value
)
{
case
TextDecoration
.
none
:
decorationDescription
+=
'none'
;
break
;
case
TextDecoration
.
underline
:
decorationDescription
+=
'underline'
;
break
;
case
TextDecoration
.
overline
:
decorationDescription
+=
'overline'
;
break
;
case
TextDecoration
.
lineThrough
:
decorationDescription
+=
'line-through'
;
break
;
}
multipleDecorations
=
true
;
}
decorationDescription
+=
'
$decoration
'
;
haveDecorationDescription
=
true
;
}
assert
(
haveDecorationDescription
);
...
...
packages/flutter/lib/src/rendering/paragraph.dart
View file @
ac0aed5a
...
...
@@ -17,12 +17,7 @@ export 'package:flutter/painting.dart' show
TextDecoration
,
TextDecorationStyle
,
TextSpan
,
TextStyle
,
normal
,
bold
,
underline
,
overline
,
lineThrough
;
TextStyle
;
/// A render object that displays a paragraph of text
class
RenderParagraph
extends
RenderBox
{
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
ac0aed5a
...
...
@@ -63,12 +63,7 @@ export 'package:flutter/rendering.dart' show
TextStyle
,
TransferMode
,
ValueChanged
,
VoidCallback
,
bold
,
normal
,
underline
,
overline
,
lineThrough
;
VoidCallback
;
// PAINTING NODES
...
...
packages/flutter/lib/src/widgets/editable_text.dart
View file @
ac0aed5a
...
...
@@ -269,7 +269,7 @@ class _EditableTextWidget extends LeafRenderObjectWidget {
TextSpan
_buildTextSpan
()
{
if
(!
hideText
&&
value
.
composing
.
isValid
)
{
TextStyle
composingStyle
=
style
.
merge
(
const
TextStyle
(
decoration:
underline
)
const
TextStyle
(
decoration:
TextDecoration
.
underline
)
);
return
new
StyledTextSpan
(
style
,
<
TextSpan
>[
...
...
packages/flutter/pubspec.yaml
View file @
ac0aed5a
...
...
@@ -7,8 +7,8 @@ dependencies:
collection
:
'
>=1.1.3
<2.0.0'
intl
:
'
>=0.12.4+2
<0.13.0'
material_design_icons
:
'
>=0.0.3
<0.1.0'
sky_engine
:
0.0.
69
sky_services
:
0.0.
69
sky_engine
:
0.0.
70
sky_services
:
0.0.
70
vector_math
:
'
>=1.4.3
<2.0.0'
# To pin the transitive dependency through mojo_sdk.
...
...
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