-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Use case
A convex shape is an alternative to the current fixed concave circular notch shape. It's just an inverted notch.
For example if you have an non-extended body and a BottomAppBar with the notch shape.
The body have a image or map as background. Not you see that the body ends on the bottom app bar. Because the background (e.g. white)is shining through the notch. Now we have to options:
- Extend the body by setting the attribute
extendBodyofScaffold. - Use an inverted notch. (this proposal) Just another shape. Or an option to the existing shape.
Proposal
It's really simple to invert the notch.
- Add a boolean option
convexto the classCircularNotchedRectanglein packageflutter/../notched_shape.dart.
//class CircularNotchedRectangle extends NotchedShape {
final bool convex;
const CircularNotchedRectangle({this.convex = false});
//}- Change some code (only 3 lines) to invert the path if the convex option is set:
//class CircularNotchedRectangle extends NotchedShape {
//@override
//Path getOuterPath(Rect host, Rect guest) {
final double p2yA = math.sqrt(r * r - p2xA * p2xA) * (convex ? -1 : 1);
final double p2yB = math.sqrt(r * r - p2xB * p2xB) * (convex ? -1 : 1);
//return Path()
//..
clockwise: convex,
//..
//)
//}
//}The question is: Do you want options here? If not you have to clone this shape. I prefer the option way. No duplicated code and easy to understand.
Default notch shape (concave) without body extended.
Default notch shape (concave) with body extended.
New optional notch shape (convex) without body extended.
infacto, huzaifah0x00, SanabriaDDi, y0nd0, richy7734 and 3 morerichy7734
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team


