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
ba635a64
Unverified
Commit
ba635a64
authored
Nov 14, 2018
by
liyuqian
Committed by
GitHub
Nov 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add golden tests for Opacity with offset (#24253)
See
https://github.com/flutter/flutter/issues/23890
parent
07c5c0ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
goldens.version
bin/internal/goldens.version
+1
-1
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+1
-0
opacity_test.dart
packages/flutter/test/widgets/opacity_test.dart
+36
-0
No files found.
bin/internal/goldens.version
View file @
ba635a64
8c478bbaf27447f3d612959705b305e7d1293526
e07cc0cb4fdf912062e71a6fd97cc91478d6e3b9
packages/flutter/lib/src/rendering/layer.dart
View file @
ba635a64
...
...
@@ -1142,6 +1142,7 @@ class OpacityLayer extends ContainerLayer {
void
debugFillProperties
(
DiagnosticPropertiesBuilder
properties
)
{
super
.
debugFillProperties
(
properties
);
properties
.
add
(
IntProperty
(
'alpha'
,
alpha
));
properties
.
add
(
DiagnosticsProperty
<
Offset
>(
'offset'
,
offset
));
}
}
...
...
packages/flutter/test/widgets/opacity_test.dart
View file @
ba635a64
...
...
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/material.dart'
;
import
'../rendering/mock_canvas.dart'
;
import
'semantics_tester.dart'
;
...
...
@@ -147,4 +150,37 @@ void main() {
semantics
.
dispose
();
});
testWidgets
(
'offset is correctly handled in Opacity'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
SingleChildScrollView
(
child:
RepaintBoundary
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
List
<
Widget
>.
generate
(
10
,
(
int
index
)
{
return
Opacity
(
opacity:
0.5
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
5.0
),
child:
Container
(
color:
Colors
.
blue
,
height:
50
),
)
);
}),
),
)
)
)
)
);
await
expectLater
(
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'opacity_test.offset.1.png'
),
skip:
!
Platform
.
isLinux
,
);
});
}
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