-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: 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.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
While trying to make my app RTL-aware, I noticed that it is not possible to simply swap out EdgeInsets with EdgeInsetsDirectional as it lacks the copyWith method, which is necessary for immutable data structures like this one.
Proposal
In flutter/packages/flutter/lib/src/painting/edge_insets.dart
/* ... */
class EdgeInsetsDirectional extends EdgeInsetsGeometry {
/* ... */
/// Creates a copy of this EdgeInsetsDirectional but with the given
/// fields replaced with the new values.
EdgeInsetsDirectional copyWith({
double? start,
double? top,
double? end,
double? bottom,
}) {
return EdgeInsetsDirectional.only(
start: start ?? this.start,
top: top ?? this.top,
end: end ?? this.end,
bottom: bottom ?? this.bottom,
);
}
/* ... */
}
/* ... */FitikWasTaken
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: 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.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team