Skip to content
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

Next #12

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Next #12

Show file tree
Hide file tree
Changes from 23 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,32 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup Flutter
uses: subosito/flutter-action@v2
- name: Install FVM
shell: bash
run: |
curl -fsSL https://fvm.app/install.sh | bash
fvm use stable --force
Comment on lines +17 to +21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Enhance security of FVM installation.

The current installation method of piping curl directly to bash poses security risks. Consider these improvements:

  1. Download the script first and verify its checksum
  2. Pin to a specific version of the install script
  3. Add error handling for the installation process

Here's a safer implementation:

-      - name: Install FVM
-        shell: bash
-        run: |
-          curl -fsSL https://fvm.app/install.sh | bash
-          fvm use stable --force
+      - name: Install FVM
+        shell: bash
+        run: |
+          INSTALL_SCRIPT="install.sh"
+          EXPECTED_SHA256="<insert_expected_sha256_here>"  # Get this from FVM's official documentation
+          
+          # Download the script
+          curl -fsSL https://fvm.app/install.sh -o "$INSTALL_SCRIPT"
+          
+          # Verify checksum
+          echo "$EXPECTED_SHA256 $INSTALL_SCRIPT" | sha256sum -c || exit 1
+          
+          # Make executable and run
+          chmod +x "$INSTALL_SCRIPT"
+          ./"$INSTALL_SCRIPT" || exit 1
+          
+          # Verify FVM installation
+          command -v fvm >/dev/null 2>&1 || { echo "FVM installation failed" >&2; exit 1; }
+          
+          fvm use stable --force || exit 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install FVM
shell: bash
run: |
curl -fsSL https://fvm.app/install.sh | bash
fvm use stable --force
- name: Install FVM
shell: bash
run: |
INSTALL_SCRIPT="install.sh"
EXPECTED_SHA256="<insert_expected_sha256_here>" # Get this from FVM's official documentation
# Download the script
curl -fsSL https://fvm.app/install.sh -o "$INSTALL_SCRIPT"
# Verify checksum
echo "$EXPECTED_SHA256 $INSTALL_SCRIPT" | sha256sum -c || exit 1
# Make executable and run
chmod +x "$INSTALL_SCRIPT"
./"$INSTALL_SCRIPT" || exit 1
# Verify FVM installation
command -v fvm >/dev/null 2>&1 || { echo "FVM installation failed" >&2; exit 1; }
fvm use stable --force || exit 1


- name: Install dependencies
run: flutter pub get
- uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action

- name: Build Runner
run: dart run build_runner build --delete-conflicting-outputs
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}

- name: Setup Melos
uses: bluefireteam/melos-action@v3

- uses: invertase/github-action-dart-analyzer@v1
with:
fatal-infos: false

- run: flutter test
fatal-warnings: false

- name: Install dependencies
run: flutter pub get

- name: Build Runner
run: melos run gen:build

- run: melos run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ build/

# Node file for website
node_modules
.local-chrome
5 changes: 5 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ command:
flutter: ">=3.19.0"
dependencies:
collection: ^1.18.0
mix: ^1.5.4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the mix package version.

Let's verify if version ^1.5.4 is the latest stable version of the mix package.


🌐 Web query:

What is the latest version of the mix package on pub.dev?

💡 Result:

The latest version of the mix package on pub.dev is 1.5.3, released in December 2024[1][8]. This update includes features like spring curve animations, improved modifier order handling, and fixes for border alignment utilities[1].

For context:

  • The package focuses on building Flutter design systems with utilities for styling, responsive layouts, and token-based theming[8].
  • It has undergone significant updates since its initial release in July 2021[4], with recent versions introducing animated styles, code generation support[1], and improved widget state management[8].

Citations:


Mix package version mismatch detected

The web query shows that the latest stable version of the mix package on pub.dev is 1.5.3, whereas the file uses ^1.5.4. This discrepancy suggests that the version in the file should be updated to ^1.5.3.

# publish:
# hooks:
# pre: melos run gen:build
Expand Down Expand Up @@ -78,6 +79,10 @@ scripts:
packageFilters:
dirExists: test

clean:
run: melos exec -- flutter clean
description: Clean all packages

brb:
run: melos run gen:build

Expand Down
11 changes: 11 additions & 0 deletions packages/superdeck/.cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
.dart_tool/
.idea/
.vscode/
coverage/
build/
ios/
macos/
web/
windows/
linux/
48 changes: 48 additions & 0 deletions packages/superdeck/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock

# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Ignoring native folders of the example as they can be re-generated easily using:
# flutter create --platforms=android,ios,web,windows,macos .


# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
build/

# FVM Version Cache
.fvm/
.firebase

# Node file for website
node_modules
.local-chrome
19 changes: 1 addition & 18 deletions packages/superdeck/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
errors:
invalid_annotation_target: ignore
body_might_complete_normally_nullable: ignore
plugins:
- custom_lint
exclude:
- '**.mapper.dart'
- '**/generated_plugin_registrant.dart'
linter:
rules:
public_member_api_docs: false
always_use_package_imports: false
prefer_relative_imports: true
library_private_types_in_public_api: false
extends: ../../shared_analysis_options.yaml
104 changes: 104 additions & 0 deletions packages/superdeck/assets/iframe_template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>iframe template</title>
<style>
/* CSS_PLACEHOLDER */
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: none;
}
</style>
<script>
// Function to load URL into iframe
function loadURL(url) {
document.getElementById('content-frame').src = url;
}




// Function to safely execute code in the iframe
function executeInIframe(code) {
return new Promise((resolve, reject) => {
const iframe = document.getElementById('content-frame');
if (!iframe) {
reject('Iframe not found');
return;
}

// Ensure the iframe is fully loaded
if (iframe.contentWindow.document.readyState === 'complete') {
try {
const result = iframe.contentWindow.eval(code);
resolve(result);
} catch (error) {
reject(error);
}
} else {
iframe.onload = () => {
try {
const result = iframe.contentWindow.eval(code);
resolve(result);
} catch (error) {
reject(error);
}
};
}
});
}


// Function to clear the DartPad editor
function clearDartPadEditor() {
return executeInIframe(`
var editor = document.querySelector('.CodeMirror')?.CodeMirror;
if (!editor) return;
editor.setValue('');
editor.setCursor({line: 0, ch: 0});
editor.focus();
console.log('DartPad editor cleared!');
`);
}

// Function to add content to the DartPad editor
function addToDartPadEditor(content) {
return executeInIframe(`
var editor = document.querySelector('.CodeMirror')?.CodeMirror;
if (!editor) return;
var currentContent = editor.getValue();
var newContent = currentContent ? currentContent + '\\n' + ${JSON.stringify(content)} : ${JSON.stringify(content)};
editor.setValue(newContent);
editor.setCursor(editor.lineCount(), 0);
editor.focus();
console.log('Content added to DartPad editor!');
`);
}

// Function to set content in the DartPad editor
function setDartPadEditorContent(content) {
return executeInIframe(`
var editor = document.querySelector('.CodeMirror')?.CodeMirror;
if (!editor) return;
editor.setValue(${JSON.stringify(content)});
editor.setCursor(editor.lineCount(), 0);
editor.focus();
console.log('DartPad editor content set!');
`);
}
</script>
</head>
<body>
<iframe id="content-frame" src="https://dartpad.dev"></iframe>

</body>
</html>
11 changes: 3 additions & 8 deletions packages/superdeck/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ targets:
mix_generator|class_utility:
generate_for:
- lib/**/*.dart

global_options:
dart_mappable_builder:
options:
caseStyle: snakeCase
enumCaseStyle: snakeCase
ignoreNull: true
generateMethods: [decode, encode, copy, stringify, equals]
mix_generator|tokens:
generate_for:
- lib/**/*.dart
3 changes: 3 additions & 0 deletions packages/superdeck/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
2 changes: 2 additions & 0 deletions packages/superdeck/example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
30 changes: 15 additions & 15 deletions packages/superdeck/example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819"
revision: "5874a72aa4c779a02553007c47dacbefba2374dc"
channel: "stable"

project_type: app
Expand All @@ -13,26 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
- platform: android
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
- platform: ios
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
- platform: linux
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
- platform: macos
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
- platform: web
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
- platform: windows
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
create_revision: 5874a72aa4c779a02553007c47dacbefba2374dc
base_revision: 5874a72aa4c779a02553007c47dacbefba2374dc

# User provided section

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
28 changes: 28 additions & 0 deletions packages/superdeck/example/.superdeck/generated_assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"last_modified": "2025-02-11T14:10:52.864184Z",
"files": [
".superdeck/assets/thumbnail_cS8UY7ii.png",
".superdeck/assets/thumbnail_nPPBLQ6k.png",
".superdeck/assets/thumbnail_WyJ8NjmF.png",
".superdeck/assets/thumbnail_F2fTbXOG.png",
".superdeck/assets/thumbnail_0zqy1l5c.png",
".superdeck/assets/thumbnail_RiDZbaFZ.png",
".superdeck/assets/thumbnail_z34aal1W.png",
".superdeck/assets/thumbnail_H2GzZVSx.png",
".superdeck/assets/thumbnail_SJncL4H2.png",
".superdeck/assets/thumbnail_ybLDY8oi.png",
".superdeck/assets/thumbnail_aTAXFyQ7.png",
".superdeck/assets/thumbnail_9mHDFwa9.png",
".superdeck/assets/thumbnail_9BmK4SPw.png",
".superdeck/assets/thumbnail_3sLdrfsM.png",
".superdeck/assets/thumbnail_oglBIjM0.png",
".superdeck/assets/thumbnail_Z40wIUYP.png",
".superdeck/assets/thumbnail_9y5hBeTm.png",
".superdeck/assets/thumbnail_CwxHOCpO.png",
".superdeck/assets/thumbnail_pukXIjvK.png",
".superdeck/assets/thumbnail_14RbmSW5.png",
".superdeck/assets/thumbnail_XeDZiCNk.png",
".superdeck/assets/mermaid_srHRIuii.png",
".superdeck/assets/mermaid_srHRIuii.png"
]
}
Loading