-
Notifications
You must be signed in to change notification settings - Fork 71
IDX support for template #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# To learn more about how to use Nix to configure your environment | ||
# see: https://developers.google.com/idx/guides/customize-idx-env | ||
{ pkgs, ... }: { | ||
# Which nixpkgs channel to use. | ||
channel = "stable-24.05"; # or "unstable" | ||
# Use https://search.nixos.org/packages to find packages | ||
packages = [ | ||
pkgs.nodePackages.firebase-tools | ||
pkgs.jdk17 | ||
pkgs.unzip | ||
]; | ||
# Sets environment variables in the workspace | ||
env = { | ||
PATH = ["/home/user/.pub-cache/bin" "/home/user/flutter/bin" "./.flutter-sdk/flutter/bin"]; | ||
}; | ||
idx = { | ||
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" | ||
extensions = [ | ||
"Dart-Code.flutter" | ||
"Dart-Code.dart-code" | ||
]; | ||
workspace = { | ||
# Runs when a workspace is first created with this `dev.nix` file | ||
onCreate = { | ||
build-flutter = '' | ||
cd /home/user/myapp/example/android | ||
|
||
./gradlew \ | ||
--parallel \ | ||
-Pverbose=true \ | ||
-Ptarget-platform=android-x86 \ | ||
-Ptarget=/home/user/myapp/lib/main.dart \ | ||
-Pbase-application-name=android.app.Application \ | ||
-Pdart-defines=RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC85NzU1MDkwN2I3MGY0ZjNiMzI4YjZjMTYwMGRmMjFmYWMxYTE4ODlhLw== \ | ||
-Pdart-obfuscation=false \ | ||
-Ptrack-widget-creation=true \ | ||
-Ptree-shake-icons=false \ | ||
-Pfilesystem-scheme=org-dartlang-root \ | ||
assembleDebug | ||
|
||
# TODO: Execute web build in debug mode. | ||
# flutter run does this transparently either way | ||
# https://github.com/flutter/flutter/issues/96283#issuecomment-1144750411 | ||
# flutter build web --profile --dart-define=Dart2jsOptimization=O0 | ||
|
||
adb -s localhost:5555 wait-for-device | ||
''; | ||
installDependencies = "flutter pub get"; | ||
}; | ||
}; | ||
# Enable previews and customize configuration | ||
previews = { | ||
enable = true; | ||
previews = { | ||
web = { | ||
command = ["flutter" "run" "--machine" "-d" "web-server" "--web-hostname" "0.0.0.0" "--web-port" "$PORT"]; | ||
manager = "flutter"; | ||
cwd = "example"; | ||
}; | ||
android = { | ||
command = ["flutter" "run" "--machine" "-d" "android" "-d" "localhost:5555"]; | ||
manager = "flutter"; | ||
cwd = "example"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} | ||
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "Flutter AI Toolkit", | ||
"description": "Flutter AI Toolkit", | ||
"categories": ["Mobile", "AI & ML"], | ||
"icon": "https://www.gstatic.com/images/branding/productlogos/flutter/v6/192px.svg", | ||
"publisher": "Google LLC", | ||
"host": { | ||
"virtualization": "true" | ||
} | ||
} | ||
rodydavis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ pkgs, ... }: { | ||
packages = [ | ||
pkgs.curl | ||
pkgs.unzip | ||
]; | ||
bootstrap = '' | ||
mkdir "$out" | ||
cp -rf ${./.}/* "$out" | ||
mkdir "$out/.idx" | ||
mkdir "$out/.vscode" | ||
mkdir "$out/font_svg" | ||
mkdir "$out/lib" | ||
mkdir "$out/example" | ||
cp -rf ${./.}/.idx "$out" | ||
cp -rf ${./.}/.vscode "$out" | ||
cp -rf ${./.}/font_svg "$out" | ||
cp -rf ${./.}/lib "$out" | ||
cp -rf ${./.}/example "$out" | ||
cp -rf ${./.}/README.md "$out" | ||
cp -rf ${./.}/CHANGELOG.md "$out" | ||
cp -rf ${./.}/LICENSE "$out" | ||
cp -rf ${./.}/pubspec.yaml "$out" | ||
cp -rf ${./.}/analysis_options.yaml "$out" | ||
cp -rf ${./.}/.metadata "$out" | ||
cp -rf ${./.}/.gitignore "$out" | ||
rm "$out/idx-template.nix" | ||
rm "$out/idx-template.json" | ||
chmod -R u+w "$out" | ||
''; | ||
} | ||
rodydavis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.