Repository navigation
Ink appears to bleed through IndexedStack #59963
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Description
Steps to reproduce
Run the following app:
import 'package:flutter/material.dart';
void main() {
runApp(BugReport());
}
class BugReport extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.ltr,
child: Material(
child: IndexedStack(
index: 0,
children: [
Ink(width: 100, height: 100, decoration: BoxDecoration(color: Colors.black)),
Ink(width: 50, height: 50, decoration: BoxDecoration(color: Colors.red)),
],
),
),
);
}
}Expected behavior
Since the index of the IndexedStack is 0, you expect to only see a 100x100 black squareL
Actual behavior
You see a 50x50 red square inside a 100x100 black square:
This can be seen at http://dartpad.dev/b636ac9a0ba8f9f901c0ae872c785d54
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue


Activity
tvolkert commentedon Jun 22, 2020
@HansMuller says "It does seem like a bug. The InkDecoration that Ink creates is going to decorate it Material ancestor unconditionally, even if it's part of the tree doesn't get painted."
xu-baolin commentedon Jul 9, 2020
I would like to work on this issue and will submit a PR in a couple of days. @HansMuller
HansMuller commentedon Jul 9, 2020
@xu-baolin - sounds good, will look for your PR
InkDecoration do not paint if it's part of the tree doesn't get paint…
InkDecoration do not paint if it's part of the tree doesn't get paint…
InkDecoration do not paint if it's part of the tree doesn't get paint…
InkDecoration do not paint if it's part of the tree doesn't get paint…
xu-baolin commentedon Jul 10, 2020
@HansMuller I have submitted the PR, #61216 please review it, thank you very much. ^_^
Optimize the algorithm to reduce the number of loops. (flutter#59963)
Pervent child not at index of IndexedStack from painting by give it a…
Perfect the test cases. (flutter#59963)
fix code style issues. (flutter#59963)
19 remaining items
HansMuller commentedon Aug 18, 2022
Lowering this to P4 because there's a workaround.
danagbemava-nc commentedon Jan 3, 2023
Reproducible on the latest versions of flutter.
screenshot
updated sample
flutter doctor -v
darkstarx commentedon Mar 5, 2023
tvolkert commentedon Mar 14, 2023
FYI I have a prototype of how I might go about solving this -- #122585
@xu-baolin interested in your thoughts since it's a different design than your original solution (which I just tried again and breaks dozens of tests inside Google projects).
tvolkert commentedon Mar 15, 2023
Ok, this is fixed in #122585 (still in review)
tvolkert commentedon Mar 25, 2023
Fixed
github-actions commentedon Apr 10, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.