-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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.
Description
Right now, Flutter only supports "inside" border in Border (source below). This is kind of frustrating as Figma has inside/center/outside options and it is not completely trivial to map them into Flutter. For outside many people use shadows, which is non-obvious.
I believe life could be easier if Border already supported this. It seems to me that the change wouldn't be big:
- Update the paint methods.
- Make the new constructor.
- Make new tests.
Possibly the code that needs to be updated:
| canvas.drawRect(rect.deflate(width / 2.0), paint); |
The implementation of something like this outside 'ring' seems too hard right now:

Sample code of the desired API.
enum StrokeAlign {
inside,
center,
outside,
}
// option A
factory Border.all({
Color color = const Color(0xFF000000),
double width = 1.0,
BorderStyle style = BorderStyle.solid,
StrokeAlign strokeAlign = StrokeAlign.center,
});
// option B
const BorderSide({
this.color = const Color(0xFF000000),
this.width = 1.0,
this.style = BorderStyle.solid,
this.strokeAlign = StrokeAlign.center,
})BirjuVachhani and spauldhaliwalBirjuVachhaniBirjuVachhani
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.