Skip to content

Instantly share code, notes, and snippets.

@eernstg
Last active October 22, 2024 14:43
Show Gist options
  • Save eernstg/495b939015270b8fa4976ae92ba872eb to your computer and use it in GitHub Desktop.
Save eernstg/495b939015270b8fa4976ae92ba872eb to your computer and use it in GitHub Desktop.
static extension EdgeInsetsGeometryExtensions on EdgeInsetsGeometry {
// Forward to EdgeInsets:
const factory EdgeInsetsGeometry.fromLTRB(
double left,
double top,
double right,
double bottom,
) = EdgeInsets.fromLTRB;
const factory EdgeInsetsGeometry.all(double value) = EdgeInsets.all;
const factory EdgeInsetsGeometry.only({
double left,
double top,
double right,
double bottom,
}) = EdgeInsets.only;
const factory EdgeInsetsGeometry.symmetric({
double vertical,
double horizontal,
}) = EdgeInsets.symmetric;
const static const EdgeInsets zero = EdgeInsets.only();
// Forward to EdgeInsetsDirectional:
const factory EdgeInsetsGeometry.fromSTEB(
double start,
double top,
double end,
double bottom,
) = EdgeInsetsDirectional.fromSTEB;
const factory EdgeInsetsGeometry.onlyDirectional({
double start,
double top,
double end,
double bottom,
}) = EdgeInsetsDirectional.only;
const factory EdgeInsetsGeometry.symmetricDirectional({
double horizontal,
double vertical,
}) => EdgeInsetsDirectional.symmetric;
const factory EdgeInsetsGeometry.allDirectional(double value) =
EdgeInsetsDirectional.all;
static const zeroDirectional = EdgeInsetsDirectional.only();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment