diff --git a/firka/lib/ui/theme/style.dart b/firka/lib/ui/theme/style.dart index 691bbfd..8ce3436 100644 --- a/firka/lib/ui/theme/style.dart +++ b/firka/lib/ui/theme/style.dart @@ -1,309 +1 @@ -import 'package:flutter/material.dart'; - -// Design system token names; ignore non_constant_identifier_names for consistency with design specs -// ignore_for_file: non_constant_identifier_names - -class FirkaFonts { - TextStyle H_H1; - TextStyle H_18px; - TextStyle H_H2; - TextStyle H_16px; - TextStyle H_14px; - TextStyle H_12px; - - TextStyle H_16px_trimmed; - - TextStyle B_16R; - TextStyle B_16SB; - TextStyle B_15SB; - - TextStyle B_14R; - TextStyle B_14SB; - - TextStyle B_12R; - TextStyle B_12SB; - - TextStyle P_14; - TextStyle P_12; - - FirkaFonts({ - required this.H_H1, - required this.H_18px, - required this.H_H2, - required this.H_16px, - required this.H_14px, - required this.H_12px, - required this.H_16px_trimmed, - required this.B_16R, - required this.B_16SB, - required this.B_15SB, - required this.B_14R, - required this.B_14SB, - required this.B_12R, - required this.B_12SB, - required this.P_14, - required this.P_12, - }); -} - -class FirkaColors { - Color background; - Color backgroundAmoled; - Color background0p; - Color success; - int shadowBlur; - - Color textPrimary; - Color textSecondary; - Color textTertiary; - - Color textPrimaryLight; - Color textSecondaryLight; - Color textTertiaryLight; - - Color card; - Color cardTranslucent; - - Color buttonSecondaryFill; - - Color accent; - Color secondary; - Color shadowColor; - Color a10p; // 10% - Color a15p; // 15% - - Color warningAccent; - Color warningText; - Color warning15p; - Color warningCard; - - Color errorAccent; - Color errorText; - Color error15p; - Color errorCard; - - Color grade5; - Color grade4; - Color grade3; - Color grade2; - Color grade1; - - FirkaColors({ - required this.background, - required this.backgroundAmoled, - required this.background0p, - required this.success, - required this.shadowBlur, - required this.textPrimary, - required this.textSecondary, - required this.textTertiary, - required this.textPrimaryLight, - required this.textSecondaryLight, - required this.textTertiaryLight, - required this.card, - required this.cardTranslucent, - required this.buttonSecondaryFill, - required this.accent, - required this.secondary, - required this.shadowColor, - required this.a10p, - required this.a15p, - required this.warningAccent, - required this.warningText, - required this.warning15p, - required this.warningCard, - required this.errorAccent, - required this.errorText, - required this.error15p, - required this.errorCard, - required this.grade5, - required this.grade4, - required this.grade3, - required this.grade2, - required this.grade1, - }); -} - -class FirkaStyle { - FirkaColors colors; - FirkaFonts fonts; - bool isLight; - - FirkaStyle({ - required this.isLight, - required this.colors, - required this.fonts, - }); -} - -final _defaultFonts = FirkaFonts( - H_H1: TextStyle( - fontSize: 30, - fontFamily: 'Montserrat', - fontVariations: [FontVariation("wght", 700)], - ), - H_18px: TextStyle( - fontSize: 18, - fontFamily: 'Montserrat', - fontVariations: [FontVariation("wght", 700)], - ), - H_H2: TextStyle( - fontSize: 20, - fontFamily: 'Montserrat', - fontVariations: [FontVariation("wght", 700)], - ), - H_16px: TextStyle( - fontSize: 16, - fontFamily: 'Montserrat', - fontVariations: [FontVariation("wght", 600)], - ), - H_14px: TextStyle( - fontSize: 14, - fontFamily: 'Montserrat', - fontVariations: [FontVariation("wght", 600)], - ), - H_12px: TextStyle( - fontSize: 12, - fontFamily: 'Montserrat', - fontVariations: [FontVariation("wght", 600)], - ), - H_16px_trimmed: TextStyle( - fontSize: 16, - fontFamily: 'Montserrat', - fontVariations: [FontVariation("wght", 600)], - height: 1.3, - ), - B_16R: TextStyle( - fontSize: 16, - fontFamily: 'Figtree', - fontVariations: [FontVariation("wght", 600)], - height: 1.3, - ), - B_16SB: TextStyle( - fontSize: 16, - fontFamily: 'Figtree', - fontVariations: [FontVariation("wght", 700)], - height: 1.3, - ), - B_14R: TextStyle( - fontSize: 14, - fontFamily: 'Figtree', - fontVariations: [FontVariation("wght", 600)], - height: 1.3, - ), - B_14SB: TextStyle( - fontSize: 14, - fontFamily: 'Figtree', - fontVariations: [FontVariation("wght", 700)], - height: 1.3, - ), - B_15SB: TextStyle( - fontSize: 15, - fontFamily: 'Figtree', - fontVariations: [FontVariation("wght", 700)], - height: 1.3, - ), - B_12R: TextStyle( - fontSize: 12, - fontFamily: 'Figtree', - fontVariations: [FontVariation("wght", 600)], - height: 1.3, - ), - B_12SB: TextStyle( - fontSize: 12, - fontFamily: 'Figtree', - fontVariations: [FontVariation("wght", 700)], - height: 1.3, - ), - P_14: TextStyle( - fontSize: 14, - fontFamily: 'RobotoMono', - fontVariations: [FontVariation("wght", 700)], - ), - P_12: TextStyle( - fontSize: 12, - fontFamily: 'RobotoMono', - fontVariations: [FontVariation("wght", 700)], - ), -); - -final FirkaStyle lightStyle = FirkaStyle( - isLight: true, - colors: FirkaColors( - background: Color(0xFFFAFFF0), - backgroundAmoled: Colors.black, - background0p: Color(0x00fafff0), - success: Color(0xFF92EA3B), - shadowBlur: 2, - textPrimary: Color(0xFF394C0A), - textSecondary: Color(0xCC394C0A), - textTertiary: Color(0x80394C0A), - textPrimaryLight: Color(0xFF394C0A), - textSecondaryLight: Color(0xCC394C0A), - textTertiaryLight: Color(0x80394C0A), - card: Color(0xFFF3FBDE), - cardTranslucent: Color(0x80F3FBDE), - buttonSecondaryFill: Color(0xFFFEFFFD), - accent: Color(0xFFA7DC22), - secondary: Color(0xFF6E8F1B), - shadowColor: Color(0x33647e22), - a10p: Color(0x1aa7dc22), - a15p: Color(0x26a7dc22), - warningAccent: Color(0xFFFFA046), - warningText: Color(0xFF8F531B), - warning15p: Color(0x26FFA046), - warningCard: Color(0xFFFAEBDC), - errorAccent: Color(0xFFFF54A1), - errorText: Color(0xFF8F1B4F), - error15p: Color(0x26FF54A1), - errorCard: Color(0xFFFADCE9), - grade5: Color(0xFF22CCAD), - grade4: Color(0xFF92EA3B), - grade3: Color(0xFFF9CF00), - grade2: Color(0xFFFFA046), - grade1: Color(0xFFFF54A1), - ), - fonts: _defaultFonts, -); - -final FirkaStyle darkStyle = FirkaStyle( - isLight: false, - colors: FirkaColors( - background: Color(0xFF0D1202), - backgroundAmoled: Colors.black, - background0p: Color(0x00fafff0), - success: Color(0xFF92EA3B), - shadowBlur: 0, - textPrimary: Color(0xFFEAF7CC), - textSecondary: Color(0xB3EAF7CC), - textTertiary: Color(0x80EAF7CC), - textPrimaryLight: Color(0xFF394C0A), - textSecondaryLight: Color(0xCC394C0A), - textTertiaryLight: Color(0x80394C0A), - card: Color(0xFF141905), - cardTranslucent: Color(0x80141905), - buttonSecondaryFill: Color(0xFF20290B), - accent: Color(0xFFA7DC22), - secondary: Color(0xFFCBEE71), - shadowColor: Color(0x26CBEE71), - a10p: Color(0x1AA7DC22), - a15p: Color(0x26A7DC22), - warningAccent: Color(0xFFFFA046), - warningText: Color(0xFFF0B37A), - warning15p: Color(0x26FFA046), - warningCard: Color(0xFF201203), - errorAccent: Color(0xFFFF54A1), - errorText: Color(0xFFF59EC5), - error15p: Color(0x26FF54A1), - errorCard: Color(0xFF1E030F), - grade5: Color(0xFF22CCAD), - grade4: Color(0xFF92EA3B), - grade3: Color(0xFFF9CF00), - grade2: Color(0xFFFFA046), - grade1: Color(0xFFFF54A1), - ), - fonts: _defaultFonts, -); - -FirkaStyle appStyle = lightStyle; -FirkaStyle wearStyle = darkStyle; +export 'package:firka_common/ui/theme/style.dart'; diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..736fb62 --- /dev/null +++ b/flake.lock @@ -0,0 +1,138 @@ +{ + "nodes": { + "android-nixpkgs": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772483868, + "narHash": "sha256-8/pEATuNjzjvn4LEpIFqluV3i4SjWqv8wfyWCKVOts4=", + "owner": "tadfisher", + "repo": "android-nixpkgs", + "rev": "9bc71fd1af6d432a736c0cbe6255988cbb05890c", + "type": "github" + }, + "original": { + "owner": "tadfisher", + "repo": "android-nixpkgs", + "type": "github" + } + }, + "devshell": { + "inputs": { + "nixpkgs": [ + "android-nixpkgs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768818222, + "narHash": "sha256-460jc0+CZfyaO8+w8JNtlClB2n4ui1RbHfPTLkpwhU8=", + "owner": "numtide", + "repo": "devshell", + "rev": "255a2b1725a20d060f566e4755dbf571bbbb5f76", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1772433332, + "narHash": "sha256-izhTDFKsg6KeVBxJS9EblGeQ8y+O8eCa6RcW874vxEc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cf59864ef8aa2e178cccedbe2c178185b0365705", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "android-nixpkgs": "android-nixpkgs", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b309943 --- /dev/null +++ b/flake.nix @@ -0,0 +1,47 @@ +{ + description = "Firka — development environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + android-nixpkgs = { + url = "github:tadfisher/android-nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, flake-utils, android-nixpkgs }: + flake-utils.lib.eachSystem [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ] (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + androidSdk = android-nixpkgs.sdk.${system} (sdkPkgs: with sdkPkgs; [ + cmdline-tools-latest + build-tools-34-0-0 + build-tools-35-0-0 + build-tools-36-1-0 + platform-tools + platforms-android-34 + platforms-android-35 + platforms-android-36 + ndk-28-2-13676358 + cmake-3-22-1 + ]); + in + { + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + flutter + git + jq + jdk17 + androidSdk + ]; + + shellHook = '' + export GRADLE_OPTS="-Dorg.gradle.project.android.aapt2FromMavenOverride=$ANDROID_HOME/build-tools/36.1.0/aapt2" + flutter --version | head -1 + dart --version + ''; + }; + }); +}