about summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2024-01-19 23:56:52 +0100
committerGitHub <noreply@github.com>2024-01-19 23:56:52 +0100
commit45308f55285c23f2576978a5afa4f72b4ed4fd5a (patch)
treea27ba74d29a61e1eefa2c704af86334c7270f62b /doc
parent8c1add25f66d30d56c5cfd84d6e1851cec927ce0 (diff)
parent64f9fa0d2c0ace8013a56cc15a86fea16c64f57b (diff)
downloadnixlib-45308f55285c23f2576978a5afa4f72b4ed4fd5a.tar
nixlib-45308f55285c23f2576978a5afa4f72b4ed4fd5a.tar.gz
nixlib-45308f55285c23f2576978a5afa4f72b4ed4fd5a.tar.bz2
nixlib-45308f55285c23f2576978a5afa4f72b4ed4fd5a.tar.lz
nixlib-45308f55285c23f2576978a5afa4f72b4ed4fd5a.tar.xz
nixlib-45308f55285c23f2576978a5afa4f72b4ed4fd5a.tar.zst
nixlib-45308f55285c23f2576978a5afa4f72b4ed4fd5a.zip
Merge pull request #281662 from hacker1024/feature/flutter-build-web
Support Web builds in buildFlutterApplication
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/dart.section.md18
1 files changed, 17 insertions, 1 deletions
diff --git a/doc/languages-frameworks/dart.section.md b/doc/languages-frameworks/dart.section.md
index fca87fa70e4e..58ee2d5050ac 100644
--- a/doc/languages-frameworks/dart.section.md
+++ b/doc/languages-frameworks/dart.section.md
@@ -80,6 +80,8 @@ Do _not_ use `dart run <package_name>`, as this will attempt to download depende
 
 ### Usage with nix-shell {#ssec-dart-applications-nix-shell}
 
+#### Using dependencies from the Nix store {#ssec-dart-applications-nix-shell-deps}
+
 As `buildDartApplication` provides dependencies instead of `pub get`, Dart needs to be explicitly told where to find them.
 
 Run the following commands in the source directory to configure Dart appropriately.
@@ -103,6 +105,9 @@ flutter.buildFlutterApplication {
   pname = "firmware-updater";
   version = "unstable-2023-04-30";
 
+  # To build for the Web, use the targetFlutterPlatform argument.
+  # targetFlutterPlatform = "web";
+
   src = fetchFromGitHub {
     owner = "canonical";
     repo = "firmware-updater";
@@ -117,4 +122,15 @@ flutter.buildFlutterApplication {
 
 ### Usage with nix-shell {#ssec-dart-flutter-nix-shell}
 
-See the [Dart documentation](#ssec-dart-applications-nix-shell) for nix-shell instructions.
+Flutter-specific `nix-shell` usage notes are included here. See the [Dart documentation](#ssec-dart-applications-nix-shell) for general `nix-shell` instructions.
+
+#### Entering the shell {#ssec-dart-flutter-nix-shell-enter}
+
+By default, dependencies for only the `targetFlutterPlatform` are available in the
+build environment. This is useful for keeping closures small, but be problematic
+during development. It's common, for example, to build Web apps for Linux during
+development to take advantage of native features such as stateful hot reload.
+
+To enter a shell with all the usual target platforms available, use the `multiShell` attribute.
+
+e.g. `nix-shell '<nixpkgs>' -A fluffychat-web.multiShell`.