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
324e20de
Unverified
Commit
324e20de
authored
Feb 11, 2020
by
Jason Simmons
Committed by
GitHub
Feb 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update TextStyle.hashCode to handle list fields (#50520)
parent
48d5fcab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
text_style.dart
packages/flutter/lib/src/painting/text_style.dart
+3
-3
text_style_test.dart
packages/flutter/test/painting/text_style_test.dart
+9
-1
No files found.
packages/flutter/lib/src/painting/text_style.dart
View file @
324e20de
...
...
@@ -1177,7 +1177,6 @@ class TextStyle extends Diagnosticable {
color
,
backgroundColor
,
fontFamily
,
fontFamilyFallback
,
fontSize
,
fontWeight
,
fontStyle
,
...
...
@@ -1191,8 +1190,9 @@ class TextStyle extends Diagnosticable {
decoration
,
decorationColor
,
decorationStyle
,
shadows
,
fontFeatures
,
hashList
(
shadows
),
hashList
(
fontFeatures
),
hashList
(
fontFamilyFallback
),
);
}
...
...
packages/flutter/test/painting/text_style_test.dart
View file @
324e20de
...
...
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
as
ui
show
TextStyle
,
ParagraphStyle
;
import
'dart:ui'
as
ui
show
TextStyle
,
ParagraphStyle
,
FontFeature
,
Shadow
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/painting.dart'
;
import
'../flutter_test_alternative.dart'
;
...
...
@@ -256,6 +257,13 @@ void main() {
expect
(
TextStyle
.
lerp
(
foo
.
merge
(
bar
),
baz
,
0.51
).
copyWith
().
debugLabel
,
'(lerp((foo).merge(bar) ⎯0.5→ baz)).copyWith'
);
});
test
(
'TextStyle.hashCode'
,
()
{
const
TextStyle
a
=
TextStyle
(
fontFamilyFallback:
<
String
>[
'Roboto'
],
shadows:
<
ui
.
Shadow
>[
ui
.
Shadow
()],
fontFeatures:
<
ui
.
FontFeature
>[
ui
.
FontFeature
(
'abcd'
)]);
const
TextStyle
b
=
TextStyle
(
fontFamilyFallback:
<
String
>[
'Noto'
],
shadows:
<
ui
.
Shadow
>[
ui
.
Shadow
()],
fontFeatures:
<
ui
.
FontFeature
>[
ui
.
FontFeature
(
'abcd'
)]);
expect
(
a
.
hashCode
,
a
.
hashCode
);
expect
(
a
.
hashCode
,
isNot
(
equals
(
b
.
hashCode
)));
},
skip:
kIsWeb
);
test
(
'TextStyle foreground and color combos'
,
()
{
const
Color
red
=
Color
.
fromARGB
(
255
,
255
,
0
,
0
);
const
Color
blue
=
Color
.
fromARGB
(
255
,
0
,
0
,
255
);
...
...
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