Skip to content

Instantly share code, notes, and snippets.

@amerblackbird
Last active February 24, 2023 14:36
Show Gist options
  • Save amerblackbird/8c33a0ba640b011a5dd295ab38fbc954 to your computer and use it in GitHub Desktop.
Save amerblackbird/8c33a0ba640b011a5dd295ab38fbc954 to your computer and use it in GitHub Desktop.
Create gap from int or double value
extension IntGapExtension on int {
/// Vertical gap
SizedBox get gv => SizedBox(height: toDouble());
/// Horizontal gap
SizedBox get gh => SizedBox(width: toDouble());
}
extension DoubleGapExtension on double {
/// Vertical gap
SizedBox get gv => SizedBox(height: this);
/// Horizontal gap
SizedBox get gh => SizedBox(width: this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment