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
7d89f216
Unverified
Commit
7d89f216
authored
Sep 25, 2020
by
MH Johnson
Committed by
GitHub
Sep 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Material] Remove opacity from dark theme overlay check (#66596)
* Remove opacity from check and add test
parent
fd935768
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
elevation_overlay.dart
packages/flutter/lib/src/material/elevation_overlay.dart
+1
-1
material_test.dart
packages/flutter/test/material/material_test.dart
+21
-0
No files found.
packages/flutter/lib/src/material/elevation_overlay.dart
View file @
7d89f216
...
...
@@ -49,7 +49,7 @@ class ElevationOverlay {
if
(
elevation
>
0.0
&&
theme
.
applyElevationOverlayColor
&&
theme
.
brightness
==
Brightness
.
dark
&&
color
==
theme
.
colorScheme
.
surface
)
{
color
.
withOpacity
(
1.0
)
==
theme
.
colorScheme
.
surface
.
withOpacity
(
1.0
)
)
{
return
Color
.
alphaBlend
(
overlayColor
(
context
,
elevation
),
color
);
}
return
color
;
...
...
packages/flutter/test/material/material_test.dart
View file @
7d89f216
...
...
@@ -343,6 +343,27 @@ void main() {
expect
(
model
.
color
,
equals
(
Colors
.
cyan
));
});
testWidgets
(
'overlay will apply to materials with a non-opaque surface color'
,
(
WidgetTester
tester
)
async
{
const
Color
surfaceColor
=
Color
(
0xFF121212
);
const
Color
surfaceColorWithOverlay
=
Color
(
0xC6353535
);
await
tester
.
pumpWidget
(
Theme
(
data:
ThemeData
(
applyElevationOverlayColor:
true
,
colorScheme:
const
ColorScheme
.
dark
(
surface:
surfaceColor
),
),
child:
buildMaterial
(
color:
surfaceColor
.
withOpacity
(.
75
),
elevation:
8.0
,
),
),
);
final
RenderPhysicalShape
model
=
getModel
(
tester
);
expect
(
model
.
color
,
equals
(
surfaceColorWithOverlay
));
expect
(
model
.
color
,
isNot
(
equals
(
surfaceColor
)));
});
});
group
(
'Transparency clipping'
,
()
{
...
...
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