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
a6532cc7
Commit
a6532cc7
authored
Apr 22, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove IconThemeData.clampedOpacity (#3483)
* Remove IconThemeData.clampedOpacity
parent
c167efca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-1
icon.dart
packages/flutter/lib/src/material/icon.dart
+1
-1
icon_theme_data.dart
packages/flutter/lib/src/material/icon_theme_data.dart
+6
-7
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+1
-0
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
a6532cc7
...
...
@@ -191,7 +191,7 @@ class AppBar extends StatelessWidget {
if
(
iconTheme
!=
null
)
{
iconTheme
=
new
IconThemeData
(
opacity:
opacity
*
iconTheme
.
clampedO
pacity
,
opacity:
opacity
*
iconTheme
.
o
pacity
,
color:
iconTheme
.
color
);
}
...
...
packages/flutter/lib/src/material/icon.dart
View file @
a6532cc7
...
...
@@ -76,7 +76,7 @@ class Icon extends StatelessWidget {
if
(
icon
==
null
)
return
new
SizedBox
(
width:
size
,
height:
size
);
final
double
iconOpacity
=
IconTheme
.
of
(
context
)?.
clampedO
pacity
??
1.0
;
final
double
iconOpacity
=
IconTheme
.
of
(
context
)?.
o
pacity
??
1.0
;
Color
iconColor
=
color
??
_getDefaultColor
(
context
);
if
(
iconOpacity
!=
1.0
)
iconColor
=
iconColor
.
withOpacity
(
iconColor
.
opacity
*
iconOpacity
);
...
...
packages/flutter/lib/src/material/icon_theme_data.dart
View file @
a6532cc7
...
...
@@ -12,23 +12,22 @@ import 'dart:ui' show Color, hashValues;
class
IconThemeData
{
/// Creates an icon theme data.
///
/// The given opacity applies to both explicit and default icon colors.
const
IconThemeData
({
this
.
color
,
this
.
opacity
});
/// The opacity applies to both explicit and default icon colors. The value
/// is clamped between 0.0 and 1.0.
const
IconThemeData
({
this
.
color
,
double
opacity:
1.0
})
:
_opacity
=
opacity
;
/// The default color for icons.
final
Color
color
;
/// An opacity to apply to both explicit and default icon colors.
final
double
opacity
;
/// Normalizes the given opacity to be between 0.0 and 1.0 (inclusive).
double
get
clampedOpacity
=>
(
opacity
??
1.0
).
clamp
(
0.0
,
1.0
);
double
get
opacity
=>
(
_opacity
??
1.0
).
clamp
(
0.0
,
1.0
);
final
double
_opacity
;
/// Linearly interpolate between two icon theme data objects.
static
IconThemeData
lerp
(
IconThemeData
begin
,
IconThemeData
end
,
double
t
)
{
return
new
IconThemeData
(
color:
Color
.
lerp
(
begin
.
color
,
end
.
color
,
t
),
opacity:
ui
.
lerpDouble
(
begin
.
clampedOpacity
,
end
.
clampedO
pacity
,
t
)
opacity:
ui
.
lerpDouble
(
begin
.
opacity
,
end
.
o
pacity
,
t
)
);
}
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
a6532cc7
...
...
@@ -96,6 +96,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> {
duration:
kThemeChangeDuration
,
child:
new
Baseline
(
baseline:
config
.
height
-
_kBaselineOffsetFromBottom
,
baselineType:
TextBaseline
.
alphabetic
,
child:
buildChild
()
)
);
...
...
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