Last active
August 20, 2021 08:47
-
-
Save nullmastermind/f090706692eacacd883468b4a1b7394c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
class Units { | |
static final md = 1.0; | |
static final xs = 0.75; | |
static final sm = 0.875; | |
static final lg = 1.125; | |
static final xl = 1.25; | |
static final xl2 = 1.5; | |
static final xl3 = 1.875; | |
static final xl4 = 2.25; | |
static final xl5 = 3.0; | |
static final xl6 = 3.75; | |
static final xl7 = 4.5; | |
static final xl8 = 6.0; | |
static final xl9 = 8.0; | |
} | |
class StyleGuide { | |
// Text | |
static final textBase = 16.sp; | |
static final textXs = Units.xs * textBase; | |
static final textSm = Units.sm * textBase; | |
static final textMd = Units.md * textBase; | |
static final textLg = Units.lg * textBase; | |
static final textXl = Units.xl * textBase; | |
static final text2Xl = Units.xl2 * textBase; | |
static final text3Xl = Units.xl3 * textBase; | |
static final text4Xl = Units.xl4 * textBase; | |
static final text5Xl = Units.xl5 * textBase; | |
static final text6Xl = Units.xl6 * textBase; | |
static final text7Xl = Units.xl7 * textBase; | |
static final text8Xl = Units.xl8 * textBase; | |
static final text9Xl = Units.xl9 * textBase; | |
// Spacing | |
static final space0 = 0.0; | |
static final space0p5 = 0.125 * textBase; // 0 point 5 | |
static final space1 = 0.25 * textBase; | |
static final space1p5 = 0.375 * textBase; | |
static final space2 = 0.5 * textBase; | |
static final space2p5 = 0.625 * textBase; | |
static final space3 = 0.75 * textBase; | |
static final space3p5 = 0.875 * textBase; | |
static final space4 = 1 * textBase; | |
static final space5 = 1.25 * textBase; | |
static final space6 = 1.5 * textBase; | |
static final space7 = 1.75 * textBase; | |
static final space8 = 2 * textBase; | |
static final space9 = 2.25 * textBase; | |
static final space10 = 2.5 * textBase; | |
static final space11 = 2.75 * textBase; | |
static final space12 = 3 * textBase; | |
static final space14 = 3.5 * textBase; | |
static final space16 = 4 * textBase; | |
static final space20 = 5 * textBase; | |
static final space24 = 6 * textBase; | |
static final space28 = 7 * textBase; | |
static final space32 = 8 * textBase; | |
static final space36 = 9 * textBase; | |
static final space40 = 10 * textBase; | |
static final space44 = 11 * textBase; | |
static final space48 = 12 * textBase; | |
static final space52 = 13 * textBase; | |
static final space56 = 14 * textBase; | |
static final space60 = 15 * textBase; | |
static final space64 = 16 * textBase; | |
static final space72 = 18 * textBase; | |
static final space80 = 20 * textBase; | |
static final space96 = 24 * textBase; | |
// | |
static final spaceBase = space6; | |
static final spaceXs = Units.xs * spaceBase; | |
static final spaceSm = Units.sm * spaceBase; | |
static final spaceMd = Units.md * spaceBase; | |
static final spaceLg = Units.lg * spaceBase; | |
static final spaceXl = Units.xl * spaceBase; | |
static final space2Xl = Units.xl2 * spaceBase; | |
static final space3Xl = Units.xl3 * spaceBase; | |
static final space4Xl = Units.xl4 * spaceBase; | |
static final space5Xl = Units.xl5 * spaceBase; | |
static final space6Xl = Units.xl6 * spaceBase; | |
static final space7Xl = Units.xl7 * spaceBase; | |
static final space8Xl = Units.xl8 * spaceBase; | |
static final space9Xl = Units.xl9 * spaceBase; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment