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
a297cb36
Unverified
Commit
a297cb36
authored
Feb 27, 2023
by
Bruno Leroux
Committed by
GitHub
Feb 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Ink decoration image does not render (#121521)
parent
d193f050
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
ink_decoration.dart
packages/flutter/lib/src/material/ink_decoration.dart
+1
-1
ink_paint_test.dart
packages/flutter/test/material/ink_paint_test.dart
+22
-14
No files found.
packages/flutter/lib/src/material/ink_decoration.dart
View file @
a297cb36
...
...
@@ -288,7 +288,7 @@ class _InkState extends State<Ink> {
_ink
!.
decoration
=
widget
.
decoration
;
_ink
!.
configuration
=
createLocalImageConfiguration
(
context
);
}
return
widget
.
child
??
const
SizedBox
(
);
return
widget
.
child
??
ConstrainedBox
(
constraints:
const
BoxConstraints
.
expand
()
);
}
@override
...
...
packages/flutter/test/material/ink_paint_test.dart
View file @
a297cb36
...
...
@@ -9,20 +9,17 @@ import 'package:flutter_test/flutter_test.dart';
import
'../rendering/mock_canvas.dart'
;
void
main
(
)
{
testWidgets
(
'The Ink widget
renders a SizedBox by defaul
t'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'The Ink widget
expands when no dimensions are se
t'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Material
(
child:
Ink
(),
),
);
Finder
sizedBox
=
find
.
descendant
(
of:
find
.
byType
(
Ink
),
matching:
find
.
byType
(
SizedBox
),
);
expect
(
sizedBox
,
findsOneWidget
);
expect
(
tester
.
getSize
(
sizedBox
).
height
,
600.0
);
expect
(
tester
.
getSize
(
sizedBox
).
width
,
800.0
);
expect
(
find
.
byType
(
Ink
),
findsOneWidget
);
expect
(
tester
.
getSize
(
find
.
byType
(
Ink
)),
const
Size
(
800.0
,
600.0
));
});
testWidgets
(
'The Ink widget fits the specified size'
,
(
WidgetTester
tester
)
async
{
const
double
height
=
150.0
;
const
double
width
=
200.0
;
await
tester
.
pumpWidget
(
...
...
@@ -36,13 +33,24 @@ void main() {
),
);
await
tester
.
pumpAndSettle
();
sizedBox
=
find
.
descendant
(
of:
find
.
byType
(
Ink
),
matching:
find
.
byType
(
SizedBox
),
expect
(
find
.
byType
(
Ink
),
findsOneWidget
);
expect
(
tester
.
getSize
(
find
.
byType
(
Ink
)),
const
Size
(
width
,
height
));
});
testWidgets
(
'The Ink widget expands on a unspecified dimension'
,
(
WidgetTester
tester
)
async
{
const
double
height
=
150.0
;
await
tester
.
pumpWidget
(
Material
(
child:
Center
(
// used to constrain to child's size
child:
Ink
(
height:
height
,
),
),
),
);
expect
(
sizedBox
,
findsNWidgets
(
2
)
);
expect
(
tester
.
getSize
(
sizedBox
.
at
(
0
)).
height
,
heigh
t
);
expect
(
tester
.
getSize
(
sizedBox
.
at
(
0
)).
width
,
width
);
await
tester
.
pumpAndSettle
(
);
expect
(
find
.
byType
(
Ink
),
findsOneWidge
t
);
expect
(
tester
.
getSize
(
find
.
byType
(
Ink
)),
const
Size
(
800
,
height
)
);
});
testWidgets
(
'The InkWell widget renders an ink splash'
,
(
WidgetTester
tester
)
async
{
...
...
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