diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 2252f56..3af4303 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.direnv/ + ### Dart ### # Files and directories created by pub diff --git a/example/pubspec.lock b/example/pubspec.lock index 4215da1..1a1e910 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -336,18 +336,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.12.0" num_utilities: dependency: transitive description: @@ -554,14 +554,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 - url: "https://pub.dev" - source: hosted - version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -587,5 +579,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0 <4.0.0" + dart: ">=3.3.0-0 <4.0.0" flutter: ">=3.16.0" diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..03b9118 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1715823142, + "narHash": "sha256-svrQv3XCcCxjf5lzMZ4BXHmU6B8a9M1H3DMa/shP1k8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a22a985f13d58b2bafb4964dd2bdf6376106a2d2", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "a22a985f13d58b2bafb4964dd2bdf6376106a2d2", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "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" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f8e9049 --- /dev/null +++ b/flake.nix @@ -0,0 +1,51 @@ +{ + inputs = { + nixpkgs.url = + "github:nixos/nixpkgs?ref=a22a985f13d58b2bafb4964dd2bdf6376106a2d2"; + # https://github.com/NixOS/nixpkgs/pull/311815 + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + config = { + android_sdk.accept_license = true; + allowUnfree = true; + }; + }; + + # Android + androidSdkArgs = { + buildToolsVersions = [ "30.0.3" ]; + platformVersions = [ "34" ]; + }; + androidComposition = + pkgs.androidenv.composeAndroidPackages androidSdkArgs; + androidSdk = androidComposition.androidsdk; + androidEmulator = pkgs.androidenv.emulateApp { + name = "Emulator"; + platformVersion = "34"; + systemImageType = "google_apis_playstore"; + abiVersion = "x86_64"; + configOptions = { + # https://android.googlesource.com/platform/external/qemu/+/refs/heads/master/android/avd/hardware-properties.ini + "hw.ramSize" = "4096"; + "hw.lcd.width" = "1170"; + "hw.lcd.height" = "2532"; + "hw.lcd.density" = "460"; + "hw.keyboard" = "yes"; + }; + sdkExtraArgs = androidSdkArgs; + }; + in { + devShell = with pkgs; + mkShell { + ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk"; + FLUTTER_ROOT = flutterPackages.v3_19; + buildInputs = [ androidEmulator androidSdk flutterPackages.v3_19 ]; + }; + }); +}