diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index ec023651..a3a4c049 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -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
- - 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
\ No newline at end of file
+ fatal-warnings: false
+
+ - name: Install dependencies
+ run: flutter pub get
+
+ - name: Build Runner
+ run: melos run gen:build
+
+ - run: melos run test
diff --git a/.gitignore b/.gitignore
index 2d7bde6b..773bfae4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,4 @@ build/
# Node file for website
node_modules
+.local-chrome
diff --git a/melos.yaml b/melos.yaml
index 91051863..bec64931 100644
--- a/melos.yaml
+++ b/melos.yaml
@@ -12,6 +12,8 @@ command:
flutter: ">=3.19.0"
dependencies:
collection: ^1.18.0
+ mix: ^1.5.4
+ ack: ^0.0.2
# publish:
# hooks:
# pre: melos run gen:build
@@ -78,6 +80,10 @@ scripts:
packageFilters:
dirExists: test
+ clean:
+ run: melos exec -- flutter clean
+ description: Clean all packages
+
brb:
run: melos run gen:build
diff --git a/packages/superdeck/.cursorignore b/packages/superdeck/.cursorignore
new file mode 100644
index 00000000..c177a801
--- /dev/null
+++ b/packages/superdeck/.cursorignore
@@ -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/
diff --git a/packages/superdeck/.gitignore b/packages/superdeck/.gitignore
new file mode 100644
index 00000000..773bfae4
--- /dev/null
+++ b/packages/superdeck/.gitignore
@@ -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
diff --git a/packages/superdeck/analysis_options.yaml b/packages/superdeck/analysis_options.yaml
index 0e5cf807..f3d426c5 100644
--- a/packages/superdeck/analysis_options.yaml
+++ b/packages/superdeck/analysis_options.yaml
@@ -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
\ No newline at end of file
+extends: ../../shared_analysis_options.yaml
diff --git a/packages/superdeck/grammars/markdown.json b/packages/superdeck/assets/grammars/markdown.json
similarity index 100%
rename from packages/superdeck/grammars/markdown.json
rename to packages/superdeck/assets/grammars/markdown.json
diff --git a/packages/superdeck/grammars/mermaid.json b/packages/superdeck/assets/grammars/mermaid.json
similarity index 100%
rename from packages/superdeck/grammars/mermaid.json
rename to packages/superdeck/assets/grammars/mermaid.json
diff --git a/packages/superdeck/grammars/python.json b/packages/superdeck/assets/grammars/python.json
similarity index 100%
rename from packages/superdeck/grammars/python.json
rename to packages/superdeck/assets/grammars/python.json
diff --git a/packages/superdeck/assets/iframe_template.html b/packages/superdeck/assets/iframe_template.html
new file mode 100644
index 00000000..ffde02f7
--- /dev/null
+++ b/packages/superdeck/assets/iframe_template.html
@@ -0,0 +1,104 @@
+
+
+
+
+
+ iframe template
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/superdeck/build.yaml b/packages/superdeck/build.yaml
index a77b33df..70ac09db 100644
--- a/packages/superdeck/build.yaml
+++ b/packages/superdeck/build.yaml
@@ -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]
\ No newline at end of file
+ mix_generator|tokens:
+ generate_for:
+ - lib/**/*.dart
diff --git a/packages/superdeck/devtools_options.yaml b/packages/superdeck/devtools_options.yaml
new file mode 100644
index 00000000..fa0b357c
--- /dev/null
+++ b/packages/superdeck/devtools_options.yaml
@@ -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:
diff --git a/packages/superdeck/example/.gitignore b/packages/superdeck/example/.gitignore
index 2cf32e94..daa03a9c 100644
--- a/packages/superdeck/example/.gitignore
+++ b/packages/superdeck/example/.gitignore
@@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
+.build/
.buildlog/
.history
.svn/
+.swiftpm/
migrate_working_dir/
# IntelliJ related
diff --git a/packages/superdeck/example/.metadata b/packages/superdeck/example/.metadata
index 90eabcff..391c336b 100644
--- a/packages/superdeck/example/.metadata
+++ b/packages/superdeck/example/.metadata
@@ -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
@@ -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
diff --git a/packages/superdeck/example/.superdeck/assets/mermaid_srHRIuii.png b/packages/superdeck/example/.superdeck/assets/mermaid_srHRIuii.png
new file mode 100644
index 00000000..ac745557
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/mermaid_srHRIuii.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_0zqy1l5c.png b/packages/superdeck/example/.superdeck/assets/thumbnail_0zqy1l5c.png
new file mode 100644
index 00000000..b439621b
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_0zqy1l5c.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_14RbmSW5.png b/packages/superdeck/example/.superdeck/assets/thumbnail_14RbmSW5.png
new file mode 100644
index 00000000..8b550691
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_14RbmSW5.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_3sLdrfsM.png b/packages/superdeck/example/.superdeck/assets/thumbnail_3sLdrfsM.png
new file mode 100644
index 00000000..528591db
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_3sLdrfsM.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_9BmK4SPw.png b/packages/superdeck/example/.superdeck/assets/thumbnail_9BmK4SPw.png
new file mode 100644
index 00000000..2a0dfe16
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_9BmK4SPw.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_9mHDFwa9.png b/packages/superdeck/example/.superdeck/assets/thumbnail_9mHDFwa9.png
new file mode 100644
index 00000000..0e2ab817
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_9mHDFwa9.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_9y5hBeTm.png b/packages/superdeck/example/.superdeck/assets/thumbnail_9y5hBeTm.png
new file mode 100644
index 00000000..5a3b4b80
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_9y5hBeTm.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_CwxHOCpO.png b/packages/superdeck/example/.superdeck/assets/thumbnail_CwxHOCpO.png
new file mode 100644
index 00000000..d6e2ad8a
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_CwxHOCpO.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_F2fTbXOG.png b/packages/superdeck/example/.superdeck/assets/thumbnail_F2fTbXOG.png
new file mode 100644
index 00000000..39525555
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_F2fTbXOG.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_H2GzZVSx.png b/packages/superdeck/example/.superdeck/assets/thumbnail_H2GzZVSx.png
new file mode 100644
index 00000000..b7fd6bb2
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_H2GzZVSx.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_RiDZbaFZ.png b/packages/superdeck/example/.superdeck/assets/thumbnail_RiDZbaFZ.png
new file mode 100644
index 00000000..e0921b85
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_RiDZbaFZ.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_SJncL4H2.png b/packages/superdeck/example/.superdeck/assets/thumbnail_SJncL4H2.png
new file mode 100644
index 00000000..37afd832
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_SJncL4H2.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_WyJ8NjmF.png b/packages/superdeck/example/.superdeck/assets/thumbnail_WyJ8NjmF.png
new file mode 100644
index 00000000..4dfab07e
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_WyJ8NjmF.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_XeDZiCNk.png b/packages/superdeck/example/.superdeck/assets/thumbnail_XeDZiCNk.png
new file mode 100644
index 00000000..26d9d411
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_XeDZiCNk.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_Z40wIUYP.png b/packages/superdeck/example/.superdeck/assets/thumbnail_Z40wIUYP.png
new file mode 100644
index 00000000..9f25523d
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_Z40wIUYP.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_aTAXFyQ7.png b/packages/superdeck/example/.superdeck/assets/thumbnail_aTAXFyQ7.png
new file mode 100644
index 00000000..f4f15328
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_aTAXFyQ7.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_cS8UY7ii.png b/packages/superdeck/example/.superdeck/assets/thumbnail_cS8UY7ii.png
new file mode 100644
index 00000000..c7be3675
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_cS8UY7ii.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_nPPBLQ6k.png b/packages/superdeck/example/.superdeck/assets/thumbnail_nPPBLQ6k.png
new file mode 100644
index 00000000..8a61edc8
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_nPPBLQ6k.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_oglBIjM0.png b/packages/superdeck/example/.superdeck/assets/thumbnail_oglBIjM0.png
new file mode 100644
index 00000000..f815f7bd
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_oglBIjM0.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_pukXIjvK.png b/packages/superdeck/example/.superdeck/assets/thumbnail_pukXIjvK.png
new file mode 100644
index 00000000..9db9955f
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_pukXIjvK.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_ybLDY8oi.png b/packages/superdeck/example/.superdeck/assets/thumbnail_ybLDY8oi.png
new file mode 100644
index 00000000..1983997f
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_ybLDY8oi.png differ
diff --git a/packages/superdeck/example/.superdeck/assets/thumbnail_z34aal1W.png b/packages/superdeck/example/.superdeck/assets/thumbnail_z34aal1W.png
new file mode 100644
index 00000000..550cc8db
Binary files /dev/null and b/packages/superdeck/example/.superdeck/assets/thumbnail_z34aal1W.png differ
diff --git a/packages/superdeck/example/.superdeck/generated/image_caching_c5tnibJL.gif b/packages/superdeck/example/.superdeck/generated/image_caching_c5tnibJL.gif
deleted file mode 100644
index 87935e86..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/image_caching_c5tnibJL.gif and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/image_caching_woxVKegn.gif b/packages/superdeck/example/.superdeck/generated/image_caching_woxVKegn.gif
deleted file mode 100644
index aaabb82d..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/image_caching_woxVKegn.gif and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/mermaid_s3Iic43G.png b/packages/superdeck/example/.superdeck/generated/mermaid_s3Iic43G.png
deleted file mode 100644
index 44cc94d2..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/mermaid_s3Iic43G.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_9aLrluQc.png b/packages/superdeck/example/.superdeck/generated/thumbnail_9aLrluQc.png
deleted file mode 100644
index 31336ca3..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_9aLrluQc.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_AbUkCAD1.png b/packages/superdeck/example/.superdeck/generated/thumbnail_AbUkCAD1.png
deleted file mode 100644
index 8907df88..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_AbUkCAD1.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_HR8xUsF0.png b/packages/superdeck/example/.superdeck/generated/thumbnail_HR8xUsF0.png
deleted file mode 100644
index 3d0120a3..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_HR8xUsF0.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_RiJb4GGG.png b/packages/superdeck/example/.superdeck/generated/thumbnail_RiJb4GGG.png
deleted file mode 100644
index 80a38e8e..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_RiJb4GGG.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_bztq1AdA.png b/packages/superdeck/example/.superdeck/generated/thumbnail_bztq1AdA.png
deleted file mode 100644
index 64f04f2d..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_bztq1AdA.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_hhnMdIWj.png b/packages/superdeck/example/.superdeck/generated/thumbnail_hhnMdIWj.png
deleted file mode 100644
index 9f452379..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_hhnMdIWj.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_kXnyZsjq.png b/packages/superdeck/example/.superdeck/generated/thumbnail_kXnyZsjq.png
deleted file mode 100644
index baf4100c..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_kXnyZsjq.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_nuiio8i0.png b/packages/superdeck/example/.superdeck/generated/thumbnail_nuiio8i0.png
deleted file mode 100644
index 62ce9e2f..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_nuiio8i0.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_q6arHVVz.png b/packages/superdeck/example/.superdeck/generated/thumbnail_q6arHVVz.png
deleted file mode 100644
index 2f0e3424..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_q6arHVVz.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_shPxXVHO.png b/packages/superdeck/example/.superdeck/generated/thumbnail_shPxXVHO.png
deleted file mode 100644
index 51e344c6..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_shPxXVHO.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated/thumbnail_xRHNCnNN.png b/packages/superdeck/example/.superdeck/generated/thumbnail_xRHNCnNN.png
deleted file mode 100644
index 46baf94e..00000000
Binary files a/packages/superdeck/example/.superdeck/generated/thumbnail_xRHNCnNN.png and /dev/null differ
diff --git a/packages/superdeck/example/.superdeck/generated_assets.json b/packages/superdeck/example/.superdeck/generated_assets.json
new file mode 100644
index 00000000..ef8e0c42
--- /dev/null
+++ b/packages/superdeck/example/.superdeck/generated_assets.json
@@ -0,0 +1,76 @@
+{
+ "last_modified": "2025-02-21T16:03:53.326253Z",
+ "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",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png",
+ ".superdeck/assets/mermaid_srHRIuii.png"
+ ]
+}
\ No newline at end of file
diff --git a/packages/superdeck/example/.superdeck/slides.json b/packages/superdeck/example/.superdeck/slides.json
deleted file mode 100644
index a2fa57e5..00000000
--- a/packages/superdeck/example/.superdeck/slides.json
+++ /dev/null
@@ -1,205 +0,0 @@
-{
- "config": {
- "transition": {
- "type": "fade_in",
- "duration": 0
- }
- },
- "slides": [
- {
- "style": "quote",
- "layout": "image",
- "options": {
- "src": "https://picsum.photos/600/600.webp",
- "fit": "cover"
- },
- "content": "> Create your Flutter presentations faster and easier than ever.\n> You can quote me on that\n> ### Leo Farias",
- "content_options": {
- "alignment": "bottom_right"
- },
- "key": "HR8xUsF0"
- },
- {
- "background": "https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZGt1MnQ5N2k3cXVma24wb3V5cThlZ3ExY2NvY3czcmozang0bGQ1ZSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/XzWd8acQ37byKR4tmd/giphy.gif",
- "style": "cover",
- "content": "# Complex layout",
- "key": "RiJb4GGG"
- },
- {
- "layout": "image",
- "content": "## Image Layout\n\nCreate beautiful slides with images that fit your content.\n\n##### Options\n```yaml\ncontent:\noptions:\n src: https//www.url.com/image.jpg\n fit: cover\n position: left\n flex: 1\n```\n\n> Define position fit and flex options for the image.",
- "style": "show_sections",
- "options": {
- "src": "https://picsum.photos/900/700?waves",
- "fit": "cover",
- "position": "left",
- "flex": 1
- },
- "content_options": {
- "alignment": "bottom_right",
- "flex": 1
- },
- "key": "hhnMdIWj"
- },
- {
- "layout": "two_column",
- "style": "show_sections",
- "sections": {
- "left": {
- "flex": 2
- },
- "right": {
- "alignment": "bottom_left"
- }
- },
- "content": "::left::\n\n# Two Column\n\nThis is a two-column layout. You can use it to compare two different concepts or ideas.\n\n::right::\n\n### Section Options\n\nEasily customize the content of each section to suit your needs.\n\nUse front matter to define the layout of each section\n\n\n```yaml\nsections:\n left:\n flex: 2\n right:\n alignment: bottom_left\n```",
- "key": "kXnyZsjq"
- },
- {
- "layout": "two_column_header",
- "content": "# Two Column + Header\n\n\n::left::\n\n### Left Section\nEasily customize the content of each section to suit your needs.\n\nUse front matter to define the layout of each section\n::right::\n\n#### Section Options\n\n```yaml\nsections:\n left:\n alignment: bottom_right\n flex: 2\n right:\n alignment: bottom_left\n header:\n alignment: bottom_left\n```",
- "sections": {
- "left": {
- "flex": 2
- },
- "right": {
- "alignment": "bottom_left"
- },
- "header": {
- "alignment": "bottom_left"
- }
- },
- "style": "show_sections",
- "content_options": {
- "alignment": "center",
- "flex": 2
- },
- "key": "bztq1AdA"
- },
- {
- "style": "rad",
- "layout": "two_column",
- "content": "# Mix\n\nIntegration with Mix gives you complete control over all styling elements in your slides with a simple and intuitive API.\n\n::right::\n\n```dart\nVariantAttribute get radStyle {\n return const SlideVariant('rad')(\n $.h1.textStyle.as(GoogleFonts.poppins()),\n $.h1.textStyle.fontSize(140),\n $.code.decoration.border.all(\n color: Colors.red,\n width: 3,\n ),\n $.code.decoration(\n color: Colors.black54,\n ),\n $.code.padding.all(40),\n\n $.outerContainer.margin.all(60),\n\n $.innerContainer.borderRadius(25),\n $.innerContainer.shadow(\n blurRadius: 0,\n spreadRadius: 10,\n color: Colors.red.withOpacity(1),\n ),\n $.innerContainer.gradient.radial(\n stops: [0.0, 1.0],\n radius: 0.7,\n colors: [Colors.purple, Colors.deepPurple],\n ),\n\n // Events\n onMouseHover((event) {\n final position = event.position;\n final dx = position.x * 10;\n final dy = position.y * 10;\n\n return Style(\n $.innerContainer.transform(_transformMatrix(position)),\n $.innerContainer.shadow.offset(dx, dy),\n $.innerContainer.gradient.radial(\n center: position,\n ),\n );\n }),\n\n (onPressed | onLongPressed)(\n $.innerContainer.shadow(\n blurRadius: 5,\n spreadRadius: 1,\n offset: Offset.zero,\n color: Colors.purpleAccent,\n ),\n $.innerContainer.border.all(color: Colors.white, width: 1),\n $.innerContainer.gradient.radial\n .colors([Colors.purpleAccent, Colors.purpleAccent]),\n ),\n );\n}\n\n```",
- "sections": {
- "left": null,
- "right": {
- "alignment": "bottom_left",
- "flex": 2
- }
- },
- "content_options": {
- "alignment": "center"
- },
- "key": "AbUkCAD1"
- },
- {
- "style": "cover",
- "background": "https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGswdWJvY2oxazJoY3g2Y2poNHBvZXlpYmd5YTg0Z2g0ODRrbng4MyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/oB6KlAvOuaLtxYy8l4/giphy.gif",
- "content": "# Markdown support",
- "key": "q6arHVVz"
- },
- {
- "style": "show_sections",
- "layout": "two_column",
- "sections": null,
- "content": "::left::\n\n\n**Bold Text**\n\n*Italic Text*\n\n~~Strikethrough~~\n\n`Inline Code`\n\n[Link here](https://github.com/leoafarias/superdeck)\n\n::right::\n\nLists\n\n1. Ordered list item 1\n2. Ordered list item 2\n\n- Unordered list item 1\n- Unordered list item 2\n\nQuotes\n\n> If you want to go fast, go alone. \n> If you want to go far, go together.\n> ### African Proverb",
- "content_options": {
- "flex": 4
- },
- "key": "shPxXVHO"
- },
- {
- "layout": "two_column",
- "content": "::left::\n\n\nCode\n```dart\nint factorial(int n) {\n return n == 0 ? 1 : n * factorial(n - 1);\n}\n\n```\n\nTasks\n- [ ] Item 1\n- [x] Item 2\n\nSubtasks\n\n- [x] Item 1\n - [ ] Subitem 1\n\n::right::\n\nImages\n\n\n\nTable\n\n| Header 1 | Header 2 |\n|----------|----------|\n| Cell 1A | Cell 1B |\n| Cell 2A | Cell 2B |\n\nDivider\n\n___",
- "key": "nuiio8i0"
- },
- {
- "title": "Mermaid example",
- "layout": "two_column",
- "content": "::left::\n\n\n \n\n::right::\n\n## Mermaid Support\n\nSuperdeck allows you to use Mermaid diagrams in your slides. It automatically converts the code into a visual representation.",
- "key": "9aLrluQc"
- },
- {
- "layout": "widget",
- "options": {
- "name": "demo",
- "args": {
- "text": "Hello, Superdeck!",
- "height": 200.0,
- "width": 300.0
- }
- },
- "content": "## Showcase your widgets",
- "key": "xRHNCnNN"
- }
- ],
- "assets": [
- {
- "path": ".superdeck/generated/thumbnail_RiJb4GGG.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/image_caching_woxVKegn.gif",
- "width": 500,
- "height": 500,
- "reference": "https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZGt1MnQ5N2k3cXVma24wb3V5cThlZ3ExY2NvY3czcmozang0bGQ1ZSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/XzWd8acQ37byKR4tmd/giphy.gif"
- },
- {
- "path": ".superdeck/generated/thumbnail_hhnMdIWj.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/thumbnail_kXnyZsjq.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/thumbnail_bztq1AdA.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/thumbnail_AbUkCAD1.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/thumbnail_q6arHVVz.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/image_caching_c5tnibJL.gif",
- "width": 270,
- "height": 480,
- "reference": "https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGswdWJvY2oxazJoY3g2Y2poNHBvZXlpYmd5YTg0Z2g0ODRrbng4MyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/oB6KlAvOuaLtxYy8l4/giphy.gif"
- },
- {
- "path": ".superdeck/generated/thumbnail_shPxXVHO.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/thumbnail_nuiio8i0.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/mermaid_s3Iic43G.png",
- "width": 600,
- "height": 866
- },
- {
- "path": ".superdeck/generated/thumbnail_9aLrluQc.png",
- "width": 512,
- "height": 288
- },
- {
- "path": ".superdeck/generated/thumbnail_xRHNCnNN.png",
- "width": 512,
- "height": 288
- }
- ]
-}
\ No newline at end of file
diff --git a/packages/superdeck/example/.superdeck/superdeck.json b/packages/superdeck/example/.superdeck/superdeck.json
new file mode 100644
index 00000000..08a347cc
--- /dev/null
+++ b/packages/superdeck/example/.superdeck/superdeck.json
@@ -0,0 +1,567 @@
+{
+ "slides": [
+ {
+ "key": "cS8UY7ii",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "\n\n## Another image Another image Another image Another image Another image Another image Another image Another image Another image Another image {.here}\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "name": "twitter",
+ "flex": 1,
+ "scrollable": false,
+ "type": "widget",
+ "username": "faafasdf",
+ "tweetId": 1746481414112256000
+ },
+ {
+ "content": " {.code}\n\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": [
+ "Test of notes"
+ ]
+ },
+ {
+ "key": "nPPBLQ6k",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "\n# Hi\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "WyJ8NjmF",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ },
+ {
+ "blocks": [
+ {
+ "content": "\n\n\n```dart\nColumn(\n crossAxisAlignment: CrossAxisAlignment.start,\n children: spans.map((span) {\n return RichText(\n text: TextSpan(\n style: interpolatedSpec.textStyle,\n children: [span],\n ),\n );\n }).toList(),\n)\n```{.code}\n",
+ "align": "center",
+ "flex": 2,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": " {.cover}",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 2,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "F2fTbXOG",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "\n\n {.code}\n\n## Another image{.here}\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": " {.cover}",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "0zqy1l5c",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "```dart\nColumn(\n crossAxisAlignment: CrossAxisAlignment.start,\n children: spans.map((span) {\n return RichText(\n text: TextSpan(\n style: interpolatedSpec.textStyle,\n children: [span],\n ),\n );\n }).toList(),\n)\n```{.code}",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "RiDZbaFZ",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "```dart\nColumn(\n children: []).toList(),\n);\n```{.code}",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "z34aal1W",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "\n\n {.cover}\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "id": "idhere",
+ "embed": true,
+ "flex": 1,
+ "scrollable": false,
+ "type": "dartpad"
+ },
+ {
+ "content": "## Yes different image{.here}",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "H2GzZVSx",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "\n\n#### Leo Farias\nleoafarias{.here}\n",
+ "align": "center_right",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "- Founder/CEO/CTO\n- Open Source Contributor\n- Flutter & Dart GDE\n- Passionate about UI/UX/DX",
+ "align": "center_left",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "SJncL4H2",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "\n> [!WARNING] \n> This presentation contains live AI-generated content. Unexpected things may occur during the demonstration. \n",
+ "align": "center_left",
+ "flex": 2,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "ybLDY8oi",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "\n### Generative UI\n",
+ "align": "center_right",
+ "flex": 2,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "\n## VS\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "### AI Assisted Code Generation",
+ "flex": 2,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "aTAXFyQ7",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "### What is Generative UI?{.animate}\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "- LLMs are great at generating content based on context\n- GUIs are great at providing structured, interactive interfaces for user input and navigation",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "9mHDFwa9",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "# LLM ❤️ GUI{.animate}",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "9BmK4SPw",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "\nCreates dynamic, context-aware UIs by interpreting actions and maintaining state with LLMs for fluid, interactive responses.{.animate}\n",
+ "align": "center",
+ "flex": 2,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "3sLdrfsM",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "### Benefits of UI over Chat{.animate}\n\n- More intuitive and user-friendly, especially for complex tasks\n- Faster feedback loop between users and LLMs\n- Enhances efficiency and interaction",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "oglBIjM0",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "\n### Flutter is Well-Suited
for Generative UI\nBuilt for any screen: Ideal for generating
adaptive UIs across devices and platforms.\n",
+ "align": "center",
+ "flex": 3,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "Z40wIUYP",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "## How can LLMs Understtand Your UI?\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "9y5hBeTm",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "\n\n### Structured Output\n",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ },
+ {
+ "content": "```dart\nfinal schema = Schema.array(\n description: 'List of recipes',\n items: Schema.object(\n properties: {\n 'recipeName': Schema.string(\n description: 'Name of the recipe.',\n nullable: false,\n ),\n },\n requiredProperties: ['recipeName'],\n ),\n);\n\n```",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "CwxHOCpO",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "```dart\nfinal model = GenerativeModel(\n model: 'gemini-1.5-pro',\n apiKey: apiKey,\n generationConfig: GenerationConfig(\n responseMimeType: 'application/json',\n responseSchema: schema,\n ),\n);\n\nfinal prompt = 'List a few popular cookie recipes.';\nfinal response = await model.generateContent([Content.text(prompt)]);\n\n```",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "pukXIjvK",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "### Color Palette Generator\n\nGenerate a color palette based on a given text.\n\n- Name of the palette\n- Font family\n- Font color\n- Color for each corner of the palette",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "14RbmSW5",
+ "options": {},
+ "sections": [
+ {
+ "blocks": [
+ {
+ "content": "```dart\nfinal schema = Schema.object(properties: {\n 'name': Schema.string(\n description:\n 'The text content to display on color palette. Format: #FF0000',\n nullable: false,\n ),\n 'font': Schema.enumString(\n enumValues: ColorPaletteFontFamily.enumString,\n description: 'The font to use for the poster text.',\n nullable: false,\n ),\n 'fontColor': Schema.string(\n description: 'The hex color value of the poster text. Format: #FF0000',\n nullable: false,\n ),\n 'topLeftColor': Schema.string(\n description:\n 'The hex color value top left corner of color palette. Format: #FF0000',\n nullable: false,\n ),\n 'topRightColor': Schema.string(\n description:\n 'The hex color value top right corner of color palette. Format: #FF0000',\n nullable: false,\n ),\n 'bottomLeftColor': Schema.string(\n description:\n 'The hex color value bottom left corner of color palette. Format: #FF0000',\n nullable: false,\n ),\n 'bottomRightColor': Schema.string(\n description:\n 'The hex color value bottom right corner of color palette. Format: #FF0000',\n nullable: false,\n )\n}, requiredProperties: [\n 'name',\n 'font',\n 'fontColor',\n 'topLeftColor',\n 'topRightColor',\n 'bottomLeftColor',\n 'bottomRightColor',\n]);\n\n```",
+ "flex": 1,
+ "scrollable": false,
+ "type": "column"
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ },
+ {
+ "key": "XeDZiCNk",
+ "options": {
+ "style": "demo"
+ },
+ "sections": [
+ {
+ "blocks": [
+ {
+ "name": "colorPalette",
+ "flex": 1,
+ "scrollable": false,
+ "type": "widget",
+ "schema": true,
+ "prompts": [
+ "tropical",
+ "vibrant",
+ "pastel",
+ "chocolatey pink unicorn",
+ "cyberpunk"
+ ]
+ }
+ ],
+ "flex": 1,
+ "scrollable": false,
+ "type": "section"
+ }
+ ],
+ "comments": []
+ }
+ ],
+ "config": {}
+}
\ No newline at end of file
diff --git a/packages/superdeck/example/assets/llm_interaction.png b/packages/superdeck/example/assets/llm_interaction.png
new file mode 100644
index 00000000..fdafbf49
Binary files /dev/null and b/packages/superdeck/example/assets/llm_interaction.png differ
diff --git a/packages/superdeck/example/assets/llm_tools.png b/packages/superdeck/example/assets/llm_tools.png
new file mode 100644
index 00000000..1221ba54
Binary files /dev/null and b/packages/superdeck/example/assets/llm_tools.png differ
diff --git a/packages/superdeck/example/assets/structured_output.png b/packages/superdeck/example/assets/structured_output.png
new file mode 100644
index 00000000..b71b0103
Binary files /dev/null and b/packages/superdeck/example/assets/structured_output.png differ
diff --git a/packages/superdeck/example/assets/widget_response.png b/packages/superdeck/example/assets/widget_response.png
new file mode 100644
index 00000000..196928cd
Binary files /dev/null and b/packages/superdeck/example/assets/widget_response.png differ
diff --git a/packages/superdeck/example/lib/main.dart b/packages/superdeck/example/lib/main.dart
index d1c5004c..8dea693f 100644
--- a/packages/superdeck/example/lib/main.dart
+++ b/packages/superdeck/example/lib/main.dart
@@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:superdeck/superdeck.dart';
+import 'src/parts/background.dart';
+import 'src/parts/footer.dart';
+import 'src/parts/header.dart';
import 'src/style.dart';
-import 'src/widget/mix_demo.dart';
void main() async {
await SuperDeckApp.initialize();
@@ -12,18 +14,49 @@ void main() async {
title: 'Superdeck',
debugShowCheckedModeBanner: false,
home: SuperDeckApp(
- styles: {
- 'rad': radStyle,
- 'custom': customStyle,
- 'cover': coverStyle,
- 'announcement': announcementStyle,
- 'quote': quoteStyle,
- 'show_sections': showSectionsStyle,
- },
- // ignore: prefer_const_literals_to_create_immutables
- examples: {'demo': mixExampleBuilder},
+ options: DeckOptions(
+ baseStyle: BaseStyle(),
+ widgets: {
+ 'twitter': (args) {
+ return TwitterWidget(
+ username: args.getString('username'),
+ tweetId: args.getString('tweetId'),
+ );
+ },
+ },
+ debug: false,
+ styles: {
+ 'announcement': AnnouncementStyle(),
+ 'quote': QuoteStyle(),
+ },
+ parts: const SlideParts(
+ header: HeaderPart(),
+ footer: FooterPart(),
+ background: BackgroundPart(),
+ ),
+ ),
),
);
}),
);
}
+
+class TwitterWidget extends StatelessWidget {
+ final String username;
+ final String tweetId;
+
+ const TwitterWidget(
+ {super.key, required this.username, required this.tweetId});
+
+ @override
+ Widget build(BuildContext context) {
+ return Row(
+ children: [
+ Container(
+ color: Colors.purple,
+ child: Text('Twitter: $username'),
+ ),
+ ],
+ );
+ }
+}
diff --git a/packages/superdeck/example/lib/src/parts/background.dart b/packages/superdeck/example/lib/src/parts/background.dart
new file mode 100644
index 00000000..f232fbd7
--- /dev/null
+++ b/packages/superdeck/example/lib/src/parts/background.dart
@@ -0,0 +1,108 @@
+import 'package:flutter/material.dart';
+import 'package:mesh/mesh.dart';
+import 'package:superdeck/superdeck.dart';
+
+// Color _colorFromHex(String hexString) {
+// hexString = hexString.trim();
+// if (hexString.isEmpty) {
+// return Colors.black; // Default color if null or empty
+// }
+// hexString = hexString.replaceAll(RegExp(r'[^a-fA-F0-9]'), '');
+// hexString = hexString.replaceAll('#', '');
+// if (hexString.length == 6) {
+// hexString = 'FF$hexString'; // Add opacity if not provided
+// }
+// return Color(int.parse(hexString, radix: 16));
+// }
+
+OMeshRect _meshBuilder(List colors) {
+ return OMeshRect(
+ width: 3,
+ height: 3,
+ fallbackColor: const Color(0xff0e0e0e),
+ backgroundColor: const Color(0x00d6d6d6),
+ vertices: [
+ (0.0, 0.0).v, (0.5, 0.0).v, (1.0, 0.0).v, // Row 1
+
+ (0.0, 0.5).v, (0.5, 0.5).v, (1.0, 0.5).v, // Row 2
+
+ (0.0, 1.0).v, (0.5, 1.0).v, (1.0, 1.0).v, // Row 3
+ ],
+ colors: colors,
+ );
+}
+
+class BackgroundPart extends StatelessWidget {
+ const BackgroundPart({
+ super.key,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final configuration = SlideConfiguration.of(context);
+
+ return _AnimatedSwitcherOMesh(
+ slide: configuration,
+ );
+ }
+}
+
+// animate bwett colors and previous colors in duration
+class _AnimatedSwitcherOMesh extends StatefulWidget {
+ final SlideConfiguration slide;
+
+ const _AnimatedSwitcherOMesh({
+ required this.slide,
+ });
+
+ @override
+ _AnimatedSwitcherOMeshState createState() => _AnimatedSwitcherOMeshState();
+}
+
+class _AnimatedSwitcherOMeshState extends State<_AnimatedSwitcherOMesh>
+ with SingleTickerProviderStateMixin {
+ late List _colors;
+
+ final _duration = const Duration(milliseconds: 1000);
+
+ @override
+ void initState() {
+ super.initState();
+ _colors = _determiniscOrderBasedOnIndex(widget.slide.slideIndex);
+ }
+
+ @override
+ void didUpdateWidget(covariant _AnimatedSwitcherOMesh oldWidget) {
+ super.didUpdateWidget(oldWidget);
+
+ if (widget.slide.slideIndex != oldWidget.slide.slideIndex) {
+ setState(() {
+ _colors = _determiniscOrderBasedOnIndex(widget.slide.slideIndex);
+ });
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return AnimatedOMeshGradient(
+ mesh: _meshBuilder(_colors),
+ duration: _duration,
+ );
+ }
+}
+
+final _buildColors = [
+ const Color.fromARGB(255, 5, 5, 28),
+ const Color.fromARGB(255, 5, 5, 5),
+ const Color.fromARGB(255, 3, 19, 48),
+ const Color.fromARGB(255, 41, 12, 56),
+ const Color.fromARGB(255, 5, 5, 5),
+ const Color.fromARGB(255, 5, 5, 5),
+ const Color.fromARGB(255, 17, 0, 63),
+ const Color.fromARGB(255, 0, 0, 0),
+ const Color.fromARGB(255, 5, 5, 5),
+];
+List _determiniscOrderBasedOnIndex(int index) {
+ return _buildColors.sublist(index % _buildColors.length)
+ ..addAll(_buildColors.sublist(0, index % _buildColors.length));
+}
diff --git a/packages/superdeck/example/lib/src/parts/footer.dart b/packages/superdeck/example/lib/src/parts/footer.dart
new file mode 100644
index 00000000..6686fb18
--- /dev/null
+++ b/packages/superdeck/example/lib/src/parts/footer.dart
@@ -0,0 +1,23 @@
+import 'package:flutter/material.dart';
+
+class FooterPart extends StatelessWidget implements PreferredSizeWidget {
+ const FooterPart({
+ super.key,
+ });
+
+ @override
+ Size get preferredSize => const Size.fromHeight(50);
+
+ @override
+ Widget build(context) {
+ return const Padding(
+ padding: EdgeInsets.symmetric(horizontal: 16.0),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ Text('SUPERDECK'),
+ ],
+ ),
+ );
+ }
+}
diff --git a/packages/superdeck/example/lib/src/parts/header.dart b/packages/superdeck/example/lib/src/parts/header.dart
new file mode 100644
index 00000000..442ca230
--- /dev/null
+++ b/packages/superdeck/example/lib/src/parts/header.dart
@@ -0,0 +1,29 @@
+import 'package:flutter/material.dart';
+import 'package:superdeck/superdeck.dart';
+
+class HeaderPart extends StatelessWidget implements PreferredSizeWidget {
+ const HeaderPart({
+ super.key,
+ });
+
+ @override
+ Size get preferredSize => const Size.fromHeight(50);
+
+ @override
+ Widget build(context) {
+ final slide = SlideConfiguration.of(context);
+
+ final index = slide.slideIndex;
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ Text(slide.options.title ?? 'Flame Game'),
+ const SizedBox(width: 20),
+ Text('${index + 1}'),
+ ],
+ ),
+ );
+ }
+}
diff --git a/packages/superdeck/example/lib/src/style.dart b/packages/superdeck/example/lib/src/style.dart
index 6ee08e0c..ed99cead 100644
--- a/packages/superdeck/example/lib/src/style.dart
+++ b/packages/superdeck/example/lib/src/style.dart
@@ -1,182 +1,115 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
+import 'package:mix/mix.dart';
import 'package:superdeck/superdeck.dart';
-final _util = SlideSpecUtility.self;
-final _h1 = _util.h1;
-final _h2 = _util.h2;
-final _h3 = _util.h3;
+class BaseStyle extends DeckStyle {
+ BaseStyle();
-final _h6 = _util.h6;
-
-final _paragraph = _util.paragraph;
-
-final _code = _util.code;
-final _blockquote = _util.blockquote;
-
-final _outerContainer = _util.outerContainer;
-final _contentContainer = _util.contentContainer;
-
-final _textStyle = _util.textStyle;
-final _innerContainer = _util.innerContainer;
-
-Style get radStyle {
- return Style(
- _h1.textStyle.as(GoogleFonts.poppins()),
- _h1.textStyle.fontSize(140),
- _code.decoration.border.all(
- color: Colors.white,
- width: 1,
- ),
- _code.decoration.color.black(),
- _code.padding.all(40),
- _outerContainer.margin.all(60),
- _innerContainer.borderRadius(25),
- _innerContainer.shadow(
- blurRadius: 0,
- spreadRadius: 10,
- color: Colors.red.withOpacity(1),
- ),
- _innerContainer.gradient.radial(
- stops: [0.0, 1.0],
- radius: 0.7,
- colors: [Colors.purple, Colors.deepPurple],
- ),
- $on.focus(
- _innerContainer.color.yellow(),
- ),
- $on.hover.event((e) {
- if (e == null) return const Style.empty();
- final position = e.position;
- final dx = position.x * 10;
- final dy = position.y * 10;
-
- return Style(
- _innerContainer.transform(_transformMatrix(position)),
- _innerContainer.shadow.offset(dx, dy),
- _innerContainer.gradient.radial(
- center: position,
- ),
- );
- }),
- ($on.press | $on.longPress)(
- _innerContainer.shadow(
- blurRadius: 5,
- spreadRadius: 1,
- offset: Offset.zero,
- color: Colors.purpleAccent,
- ),
- _innerContainer.border.all(color: Colors.white, width: 1),
- _innerContainer.gradient.radial
- .colors([Colors.purpleAccent, Colors.purpleAccent]),
- ),
- );
+ @override
+ Style build() {
+ return super.build().merge(
+ Style(
+ // $.baseTextStyle.as(GoogleFonts.poppins()),
+ // $.h1.chain
+ // ..style.fontWeight.w900()
+ // ..style.fontSize(100),
+ // $.h2.chain
+ // ..style.fontWeight.w100()
+ // ..style.fontSize(80),
+ // $.h3.chain..style.fontSize(36),
+ // $.alert.all.chain
+ // ..heading.style.fontSize(24)
+ // ..icon.size(36)
+ // ..description.style.fontSize(24)
+ // ..description.style.fontWeight.w400(),
+ // $.alert.note.chain
+ // ..heading.style.color(_accent)
+ // ..icon.color(_accent)
+ // ..container.border.left.color(_accent),
+ // $.code.chain
+ // ..textStyle.as(GoogleFonts.jetBrainsMono())
+ // ..decoration.color(
+ // const Color.fromARGB(255, 3, 17, 19),
+ // )
+ // ..decoration.border.all(
+ // color: const Color.fromARGB(255, 6, 49, 50),
+ // width: 1,
+ // ),
+ ),
+ );
+ }
}
-Style get customStyle {
- return Style(
- _textStyle.as(GoogleFonts.poppins()),
- _h1.textStyle.as(GoogleFonts.smooch()),
- _h1.textStyle.fontSize(200),
- _h1.textStyle.height(0),
- _h1.textStyle.shadow(
- color: Colors.deepOrange,
- blurRadius: 20,
- ),
- _h2.textStyle.fontSize(36),
- _contentContainer.borderRadius(25),
- _innerContainer.gradient.linear(
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- colors: [
- Colors.black.withOpacity(0.5),
- Colors.deepPurple.withOpacity(0.9),
- ],
- ),
- _contentContainer.padding.vertical(0),
- _outerContainer.padding(40),
- _outerContainer.gradient.linear(
- colors: [
- Colors.red,
- Colors.redAccent,
- ],
- ),
- _innerContainer.borderRadius(25),
- _innerContainer.border.all(
- color: Colors.deepOrange,
- width: 4,
- ),
- _innerContainer.shadow(
- color: Colors.black.withOpacity(0.4),
- blurRadius: 20,
- spreadRadius: 5,
- ),
- );
-}
-
-Style get coverStyle {
- return Style(
- _h1.textStyle.as(GoogleFonts.poppins()),
- _h1.textStyle.fontSize(100),
- _contentContainer.gradient.linear(
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- colors: [
- Colors.black.withOpacity(0.5),
- Colors.black.withOpacity(0.95),
- ],
- ),
- );
-}
-
-Style get announcementStyle {
- return Style(
- _textStyle.height(0.6),
- _h1.textStyle.fontSize(140),
- _h1.textStyle.bold(),
- _h1.textStyle.color(Colors.yellow),
- _h2.textStyle.fontSize(140),
- _h3.textStyle.fontSize(60),
- _h3.textStyle.color(Colors.white),
- _h3.textStyle.fontWeight(FontWeight.w100),
- _contentContainer.gradient.linear(
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- colors: [
- Colors.black.withOpacity(0.5),
- Colors.black.withOpacity(0.95),
- ],
- ),
- );
-}
+class CoverStyle extends DeckStyle {
+ CoverStyle();
-Style get quoteStyle {
- return Style(
- _blockquote.textStyle.as(GoogleFonts.notoSerif()),
- _blockquote.decoration.border.left(
- width: 4,
- color: Colors.red,
- ),
- _paragraph.textStyle.fontSize(32),
- _h6.textStyle.as(GoogleFonts.notoSerif()),
- _h6.textStyle.fontSize(20),
- );
+ @override
+ Style build() {
+ return super.build().merge(
+ Style(
+ $.h1.chain
+ ..style.as(GoogleFonts.poppins())
+ ..style.fontSize(100),
+ $.blockContainer.gradient.linear(
+ begin: Alignment.topCenter,
+ end: Alignment.bottomCenter,
+ colors: [
+ Colors.black.useOpacity(0.5),
+ Colors.black.useOpacity(0.95),
+ ],
+ ),
+ ),
+ );
+ }
}
-Style get showSectionsStyle {
- return Style(
- _contentContainer.border.all(
- color: Colors.blue,
- width: 2,
- ),
- );
+class AnnouncementStyle extends DeckStyle {
+ AnnouncementStyle();
+ @override
+ Style build() {
+ return super.build().merge(
+ Style(
+ $.baseTextStyle.height(0.6),
+ $.h1.chain
+ ..style.fontSize(140)
+ ..style.bold()
+ ..style.color(const Color.fromARGB(255, 201, 195, 139)),
+ $.h2.style.fontSize(140),
+ $.h3.chain
+ ..style.fontSize(60)
+ ..style.color(Colors.white)
+ ..style.fontWeight(FontWeight.w100),
+ $.blockContainer.gradient.linear(
+ begin: Alignment.topCenter,
+ end: Alignment.bottomCenter,
+ colors: [
+ Colors.black.useOpacity(0.5),
+ Colors.black.useOpacity(0.95),
+ ],
+ ),
+ ),
+ );
+ }
}
-Matrix4 _transformMatrix(Alignment alignment) {
- final double rotateX = alignment.y * 0.2;
- final double rotateY = -alignment.x * 0.2;
- return Matrix4.identity()
- ..rotateX(rotateX)
- ..rotateY(rotateY)
- ..translate(0.0, 0.0, 100.0);
+class QuoteStyle extends DeckStyle {
+ QuoteStyle();
+ @override
+ Style build() {
+ return super.build().merge(
+ Style(
+ $.blockquote.chain
+ ..textStyle.as(GoogleFonts.notoSerif())
+ ..decoration.border.left(
+ width: 4,
+ color: Colors.red,
+ ),
+ $.p.style.fontSize(32),
+ $.h6.chain
+ ..style.as(GoogleFonts.notoSerif())
+ ..style.fontSize(20),
+ ),
+ );
+ }
}
diff --git a/packages/superdeck/example/lib/src/widget/mix_demo.dart b/packages/superdeck/example/lib/src/widget/mix_demo.dart
deleted file mode 100644
index 0f8a2ffd..00000000
--- a/packages/superdeck/example/lib/src/widget/mix_demo.dart
+++ /dev/null
@@ -1,137 +0,0 @@
-import 'dart:math' as math;
-
-import 'package:flutter/material.dart';
-import 'package:superdeck/components/molecules/code_preview.dart';
-import 'package:superdeck/schema/schema_model.dart';
-import 'package:superdeck/superdeck.dart';
-
-const purpleAccent = Color.fromARGB(255, 95, 44, 188);
-const purple = Color.fromARGB(255, 66, 19, 152);
-
-Style get _style => Style(
- // Box
- $box.height(250),
- $box.width(250),
- $box.borderRadius.circular(10),
- $box.alignment.center(),
- $box.shadow(
- blurRadius: 20,
- spreadRadius: 10,
- color: Colors.black.withOpacity(0.5),
- ),
- $box.gradient.radial(
- stops: [0.0, 1.0],
- radius: 0.7,
- colors: [purpleAccent, purple],
- ),
- // Decorators
- $with.scale(1.0),
- $with.opacity(1),
- // Text
- $text.textAlign.center(),
- $text.style.shadow.blurRadius(2),
- $text.style(
- color: Colors.white,
- fontSize: 32,
- ),
- // Events
- $on.hover.event((e) {
- if (e == null) return const Style.empty();
- final position = e.position;
- final dx = position.x * 10;
- final dy = position.y * 10;
-
- final opacityDistance = _calculateDistance(position);
-
- return Style(
- $text.style.shadow.color.black.withOpacity(opacityDistance),
- $text.style.shadow.offset(-dx, -dy),
- $box.transform(_transformMatrix(position)),
- $box.shadow.offset(dx, dy),
- $box.gradient.radial.center(position),
- );
- }),
-
- $on.hover(
- $box.color.black(),
- ),
-
- ($on.press | $on.longPress)(
- $box.shadow(
- blurRadius: 5,
- spreadRadius: 1,
- offset: Offset.zero,
- color: purpleAccent,
- ),
- $box.border(color: Colors.white, width: 1),
- $box.gradient.radial.colors([purpleAccent, purpleAccent]),
- $text.style.shadow.offset.zero(),
- $with.scale(0.95),
- ),
- );
-
-class ExampleOptions {
- final double height;
- final double width;
- final String? text;
- const ExampleOptions({
- required this.height,
- required this.width,
- this.text,
- });
-
- static ExampleOptions fromMap(Map map) {
- return ExampleOptions(
- height: map['height'] as double,
- width: map['width'] as double,
- text: map['text'] as String?,
- );
- }
-
- static final schema = ArgsSchema(
- validator: SchemaShape(
- {
- 'height': Schema.double.required(),
- 'width': Schema.double.required(),
- 'text': Schema.string.required(),
- },
- ),
- decoder: fromMap,
- );
-}
-
-Widget mixExampleBuilder(BuildContext context) {
- final options = ExampleOptions.fromMap(context.args);
- return Builder(
- builder: (context) {
- return Center(
- child: Box(
- style: Style(
- _style(),
- $box.height(options.height),
- $box.width(options.width),
- ).animate(),
- child: StyledText(
- options.text ?? 'Mix',
- ),
- ),
- );
- },
- );
-}
-
-double _calculateDistance(Alignment alignment) {
- final distance =
- -math.sqrt(alignment.x * alignment.x + alignment.y * alignment.y) / 1.5;
-
- return 1 - math.min(distance.abs(), 1);
-}
-
-Matrix4 _transformMatrix(Alignment alignment) {
- final double rotateX = alignment.y * 0.2;
- final double rotateY = -alignment.x * 0.2;
- return Matrix4.identity()
- ..rotateX(rotateX)
- ..rotateY(rotateY)
- ..translate(0.0, 0.0, 100.0);
-}
diff --git a/packages/superdeck/example/linux/flutter/generated_plugin_registrant.cc b/packages/superdeck/example/linux/flutter/generated_plugin_registrant.cc
index c84268e3..ebe9c0a3 100644
--- a/packages/superdeck/example/linux/flutter/generated_plugin_registrant.cc
+++ b/packages/superdeck/example/linux/flutter/generated_plugin_registrant.cc
@@ -8,7 +8,7 @@
#include
#include
-#include
+#include
#include
#include
@@ -19,9 +19,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
- g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
- fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
- screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
+ g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
+ fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
+ screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
diff --git a/packages/superdeck/example/linux/flutter/generated_plugins.cmake b/packages/superdeck/example/linux/flutter/generated_plugins.cmake
index 66f0a374..5f72d152 100644
--- a/packages/superdeck/example/linux/flutter/generated_plugins.cmake
+++ b/packages/superdeck/example/linux/flutter/generated_plugins.cmake
@@ -5,7 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
file_saver
file_selector_linux
- screen_retriever
+ screen_retriever_linux
url_launcher_linux
window_manager
)
diff --git a/packages/superdeck/example/macos/Flutter/GeneratedPluginRegistrant.swift b/packages/superdeck/example/macos/Flutter/GeneratedPluginRegistrant.swift
index 811a3726..2a2a3c4f 100644
--- a/packages/superdeck/example/macos/Flutter/GeneratedPluginRegistrant.swift
+++ b/packages/superdeck/example/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -5,20 +5,24 @@
import FlutterMacOS
import Foundation
+import file_picker
import file_saver
import file_selector_macos
import path_provider_foundation
-import screen_retriever
-import sqflite
+import screen_retriever_macos
+import sqflite_darwin
import url_launcher_macos
+import webview_flutter_wkwebview
import window_manager
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
+ FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
FileSaverPlugin.register(with: registry.registrar(forPlugin: "FileSaverPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
- ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
+ ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
+ WebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "WebViewFlutterPlugin"))
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
}
diff --git a/packages/superdeck/example/macos/Podfile.lock b/packages/superdeck/example/macos/Podfile.lock
index 4365112a..0e823b21 100644
--- a/packages/superdeck/example/macos/Podfile.lock
+++ b/packages/superdeck/example/macos/Podfile.lock
@@ -1,4 +1,6 @@
PODS:
+ - file_picker (0.0.1):
+ - FlutterMacOS
- file_saver (0.0.1):
- FlutterMacOS
- file_selector_macos (0.0.1):
@@ -7,27 +9,34 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- - screen_retriever (0.0.1):
+ - screen_retriever_macos (0.0.1):
- FlutterMacOS
- - sqflite (0.0.3):
+ - sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
+ - webview_flutter_wkwebview (0.0.1):
+ - Flutter
+ - FlutterMacOS
- window_manager (0.2.0):
- FlutterMacOS
DEPENDENCIES:
+ - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`)
- file_saver (from `Flutter/ephemeral/.symlinks/plugins/file_saver/macos`)
- file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- - screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
- - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`)
+ - screen_retriever_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos`)
+ - sqflite_darwin (from `Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
+ - webview_flutter_wkwebview (from `Flutter/ephemeral/.symlinks/plugins/webview_flutter_wkwebview/darwin`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
EXTERNAL SOURCES:
+ file_picker:
+ :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos
file_saver:
:path: Flutter/ephemeral/.symlinks/plugins/file_saver/macos
file_selector_macos:
@@ -36,25 +45,29 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
- screen_retriever:
- :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos
- sqflite:
- :path: Flutter/ephemeral/.symlinks/plugins/sqflite/darwin
+ screen_retriever_macos:
+ :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos
+ sqflite_darwin:
+ :path: Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
+ webview_flutter_wkwebview:
+ :path: Flutter/ephemeral/.symlinks/plugins/webview_flutter_wkwebview/darwin
window_manager:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
SPEC CHECKSUMS:
- file_saver: 44e6fbf666677faf097302460e214e977fdd977b
- file_selector_macos: 54fdab7caa3ac3fc43c9fac4d7d8d231277f8cf2
+ file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a
+ file_saver: e35bd97de451dde55ff8c38862ed7ad0f3418d0f
+ file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
- path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
- screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
- sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
- url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399
- window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8
+ path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
+ screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f
+ sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
+ url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
+ webview_flutter_wkwebview: 1821ceac936eba6f7984d89a9f3bcb4dea99ebb2
+ window_manager: 1d01fa7ac65a6e6f83b965471b1a7fdd3f06166c
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
-COCOAPODS: 1.15.2
+COCOAPODS: 1.16.2
diff --git a/packages/superdeck/example/macos/Runner.xcodeproj/project.pbxproj b/packages/superdeck/example/macos/Runner.xcodeproj/project.pbxproj
index 652a4230..8de28ead 100644
--- a/packages/superdeck/example/macos/Runner.xcodeproj/project.pbxproj
+++ b/packages/superdeck/example/macos/Runner.xcodeproj/project.pbxproj
@@ -27,8 +27,8 @@
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
- D33EC936C6603F092BE164F8 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 58206CAA5C9CAE5E71ACD682 /* Pods_Runner.framework */; };
- DC6D6673B8F35A47BEC03AAD /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6840468B539A3E04B679E96 /* Pods_RunnerTests.framework */; };
+ 3C7F02F531EE8B8E96FDCD85 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67704BDC61896D7D1ED432F9 /* Pods_Runner.framework */; };
+ FA047FDAACF132C8FDCAE309 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E600C98B2532AC2785701EE /* Pods_RunnerTests.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -62,6 +62,8 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 1E600C98B2532AC2785701EE /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 21511E81602A801A8E21C7CD /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; };
@@ -78,16 +80,14 @@
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; };
- 58206CAA5C9CAE5E71ACD682 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 52F74288AF9AF86ABCFE970F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
+ 581C05F03DD9D309B121AAEE /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; };
+ 67704BDC61896D7D1ED432F9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 70C3E6D656304B99FD0B1289 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; };
- 96D02405CAB3337A8B12E29B /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; };
+ 82524DD4DD10587301372C85 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; };
- B9852E5A6795285C786AC0A5 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; };
- C6840468B539A3E04B679E96 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- D549EC79AC8D2DF1C27D4870 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
- DA04FC470987408FF8C57926 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
- E2BD03C4940642B10DF984FF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
- FEF4F6D79728354A6C21CACE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
+ D8DAC3BC7E807CD0F32FD395 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -95,7 +95,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- DC6D6673B8F35A47BEC03AAD /* Pods_RunnerTests.framework in Frameworks */,
+ FA047FDAACF132C8FDCAE309 /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -103,7 +103,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- D33EC936C6603F092BE164F8 /* Pods_Runner.framework in Frameworks */,
+ 3C7F02F531EE8B8E96FDCD85 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -137,7 +137,7 @@
331C80D6294CF71000263BE5 /* RunnerTests */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
- D5950B1D48D0D7CEF81BA26B /* Pods */,
+ EE39A6A2A55017D82C9C3078 /* Pods */,
);
sourceTree = "";
};
@@ -185,27 +185,27 @@
path = Runner;
sourceTree = "";
};
- D5950B1D48D0D7CEF81BA26B /* Pods */ = {
+ D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
- FEF4F6D79728354A6C21CACE /* Pods-Runner.debug.xcconfig */,
- E2BD03C4940642B10DF984FF /* Pods-Runner.release.xcconfig */,
- DA04FC470987408FF8C57926 /* Pods-Runner.profile.xcconfig */,
- 96D02405CAB3337A8B12E29B /* Pods-RunnerTests.debug.xcconfig */,
- D549EC79AC8D2DF1C27D4870 /* Pods-RunnerTests.release.xcconfig */,
- B9852E5A6795285C786AC0A5 /* Pods-RunnerTests.profile.xcconfig */,
+ 67704BDC61896D7D1ED432F9 /* Pods_Runner.framework */,
+ 1E600C98B2532AC2785701EE /* Pods_RunnerTests.framework */,
);
- name = Pods;
- path = Pods;
+ name = Frameworks;
sourceTree = "";
};
- D73912EC22F37F3D000D13A0 /* Frameworks */ = {
+ EE39A6A2A55017D82C9C3078 /* Pods */ = {
isa = PBXGroup;
children = (
- 58206CAA5C9CAE5E71ACD682 /* Pods_Runner.framework */,
- C6840468B539A3E04B679E96 /* Pods_RunnerTests.framework */,
+ 21511E81602A801A8E21C7CD /* Pods-Runner.debug.xcconfig */,
+ 52F74288AF9AF86ABCFE970F /* Pods-Runner.release.xcconfig */,
+ 70C3E6D656304B99FD0B1289 /* Pods-Runner.profile.xcconfig */,
+ D8DAC3BC7E807CD0F32FD395 /* Pods-RunnerTests.debug.xcconfig */,
+ 82524DD4DD10587301372C85 /* Pods-RunnerTests.release.xcconfig */,
+ 581C05F03DD9D309B121AAEE /* Pods-RunnerTests.profile.xcconfig */,
);
- name = Frameworks;
+ name = Pods;
+ path = Pods;
sourceTree = "";
};
/* End PBXGroup section */
@@ -215,7 +215,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
- 19EEF7D0A3B09786CF680AFC /* [CP] Check Pods Manifest.lock */,
+ E1EAB9F2FA8DCA9689F733BC /* [CP] Check Pods Manifest.lock */,
331C80D1294CF70F00263BE5 /* Sources */,
331C80D2294CF70F00263BE5 /* Frameworks */,
331C80D3294CF70F00263BE5 /* Resources */,
@@ -234,13 +234,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
- D54F2E16B80C97964B7F5826 /* [CP] Check Pods Manifest.lock */,
+ 1EDCDE1967A52C0C5A85096D /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
- C22D8E44EE0F21092537C376 /* [CP] Embed Pods Frameworks */,
+ 835DD4EE6B9B696A485C6794 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -323,7 +323,7 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- 19EEF7D0A3B09786CF680AFC /* [CP] Check Pods Manifest.lock */ = {
+ 1EDCDE1967A52C0C5A85096D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -338,7 +338,7 @@
outputFileListPaths = (
);
outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@@ -383,7 +383,7 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
- C22D8E44EE0F21092537C376 /* [CP] Embed Pods Frameworks */ = {
+ 835DD4EE6B9B696A485C6794 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -400,7 +400,7 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
- D54F2E16B80C97964B7F5826 /* [CP] Check Pods Manifest.lock */ = {
+ E1EAB9F2FA8DCA9689F733BC /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -415,7 +415,7 @@
outputFileListPaths = (
);
outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+ "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@@ -473,7 +473,7 @@
/* Begin XCBuildConfiguration section */
331C80DB294CF71000263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 96D02405CAB3337A8B12E29B /* Pods-RunnerTests.debug.xcconfig */;
+ baseConfigurationReference = D8DAC3BC7E807CD0F32FD395 /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -488,7 +488,7 @@
};
331C80DC294CF71000263BE5 /* Release */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = D549EC79AC8D2DF1C27D4870 /* Pods-RunnerTests.release.xcconfig */;
+ baseConfigurationReference = 82524DD4DD10587301372C85 /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -503,7 +503,7 @@
};
331C80DD294CF71000263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = B9852E5A6795285C786AC0A5 /* Pods-RunnerTests.profile.xcconfig */;
+ baseConfigurationReference = 581C05F03DD9D309B121AAEE /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
diff --git a/packages/superdeck/example/macos/Runner/AppDelegate.swift b/packages/superdeck/example/macos/Runner/AppDelegate.swift
index 8e02df28..b3c17614 100644
--- a/packages/superdeck/example/macos/Runner/AppDelegate.swift
+++ b/packages/superdeck/example/macos/Runner/AppDelegate.swift
@@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
+
+ override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
+ return true
+ }
}
diff --git a/packages/superdeck/example/macos/Runner/Release.entitlements b/packages/superdeck/example/macos/Runner/Release.entitlements
index 08ba3a3f..85c03d7b 100644
--- a/packages/superdeck/example/macos/Runner/Release.entitlements
+++ b/packages/superdeck/example/macos/Runner/Release.entitlements
@@ -3,8 +3,12 @@
com.apple.security.app-sandbox
-
+
+ com.apple.security.files.user-selected.read-write
+
com.apple.security.network.client
+ com.apple.security.network.server
+
diff --git a/packages/superdeck/example/pubspec.yaml b/packages/superdeck/example/pubspec.yaml
index 0bdfffe6..14fbca1f 100644
--- a/packages/superdeck/example/pubspec.yaml
+++ b/packages/superdeck/example/pubspec.yaml
@@ -1,29 +1,25 @@
-name: superdeck_example
+name: 'superdeck_example'
description: An example presentation for SuperDeck
-
-publish_to: "none" # Remove this line if you wish to publish to pub.dev
-
-version: 1.0.0+1
-
+publish_to: none
+version: '1.0.0+1'
environment:
- sdk: ">=3.3.0 <4.0.0"
-
+ sdk: '>=3.3.0 <4.0.0'
+ flutter: '>=3.19.0'
dependencies:
flutter:
sdk: flutter
- google_fonts: ^6.2.0
- superdeck:
- path: ../
-
+ google_fonts: '^6.2.1'
+ mesh: '^0.4.1'
+ mix: '^1.5.4'
+ superdeck: '^0.0.1'
dev_dependencies:
flutter_test:
sdk: flutter
- flutter_lints: ^3.0.2
- superdeck_cli:
- path: ../../superdeck_cli
-
+ flutter_lints: '^4.0.0'
+ superdeck_cli: '^0.0.1'
flutter:
uses-material-design: true
assets:
+ - assets/
- .superdeck/
- - .superdeck/generated/
\ No newline at end of file
+ - .superdeck/assets/
diff --git a/packages/superdeck/example/pubspec_overrides.yaml b/packages/superdeck/example/pubspec_overrides.yaml
index 32c9384f..926997bd 100644
--- a/packages/superdeck/example/pubspec_overrides.yaml
+++ b/packages/superdeck/example/pubspec_overrides.yaml
@@ -1,10 +1,8 @@
-# melos_managed_dependency_overrides: superdeck,superdeck_cli
+# melos_managed_dependency_overrides: superdeck,superdeck_cli,superdeck_core
dependency_overrides:
- # mix_generator:
- # path: ../../mix/packages/mix_generator
- # mix:
- # path: ../../mix/packages/mix
superdeck:
path: ..
superdeck_cli:
path: ../../superdeck_cli
+ superdeck_core:
+ path: ../../superdeck_core
diff --git a/packages/superdeck/example/slides.md b/packages/superdeck/example/slides.md
index d1b447f4..963a5d8c 100644
--- a/packages/superdeck/example/slides.md
+++ b/packages/superdeck/example/slides.md
@@ -1,324 +1,335 @@
---
-style: quote
-layout: image
-options:
- src: https://picsum.photos/600/600.webp
- fit: cover
-content:
- alignment: bottom_right
----
-> Create your Flutter presentations faster and easier than ever.
-> You can quote me on that
-> ### Leo Farias
+@column
----
-background: https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZGt1MnQ5N2k3cXVma24wb3V5cThlZ3ExY2NvY3czcmozang0bGQ1ZSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/XzWd8acQ37byKR4tmd/giphy.gif
-style: cover
----
+## Another image Another image Another image Another image Another image Another image Another image Another image Another image Another image {.here}
-# Complex layout
+@twitter {
+ username: faafasdf
+ tweetId: 1746481414112256000
+}
----
-layout: image
-content:
- alignment: bottom_right
- flex: 1
-style: show_sections
-options:
- src: https://picsum.photos/900/700?waves
- fit: cover
- position: left
- flex: 1
----
+@column
-## Image Layout
+```mermaid
+graph TD
+ A[Start] --> B[Input]
+ B --> C[Process]
+ C --> D[Output]
+ D --> E[End]
+``` {.code}
-Create beautiful slides with images that fit your content.
+
-##### Options
-```yaml
-content:
-options:
- src: https//www.url.com/image.jpg
- fit: cover
- position: left
- flex: 1
-```
+---
-> Define position fit and flex options for the image.
+@column
+
+@column
+# Hi
+@column
----
-layout: two_column
-style: show_sections
-sections:
- left:
- flex: 2
- right:
- alignment: bottom_left
---
-::left::
+@section
+@section {flex: 2}
+@column {
+ align: center
+ flex: 2
+}
-# Two Column
-This is a two-column layout. You can use it to compare two different concepts or ideas.
+```dart
+Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: spans.map((span) {
+ return RichText(
+ text: TextSpan(
+ style: interpolatedSpec.textStyle,
+ children: [span],
+ ),
+ );
+ }).toList(),
+)
+```{.code}
-::right::
+@column
-### Section Options
+ {.cover}
-Easily customize the content of each section to suit your needs.
+---
-Use front matter to define the layout of each section
+@column
-```yaml
-sections:
- left:
- flex: 2
- right:
- alignment: bottom_left
-```
+```mermaid
+graph TD
+ A[Start] --> B[Input]
+ B --> C[Process]
+ C --> D[Output]
+ D --> E[End]
+``` {.code}
+
+## Another image{.here}
+
+@column
+
+ {.cover}
---
-layout: two_column_header
-content:
- alignment: center
- flex: 2
-sections:
- left:
- flex: 2
- right:
- alignment: bottom_left
- header:
- alignment: bottom_left
-style: show_sections
+
+```dart
+Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: spans.map((span) {
+ return RichText(
+ text: TextSpan(
+ style: interpolatedSpec.textStyle,
+ children: [span],
+ ),
+ );
+ }).toList(),
+)
+```{.code}
+
---
-# Two Column + Header
+```dart
+Column(
+ children: []).toList(),
+);
+```{.code}
+---
-::left::
+@column
-### Left Section
-Easily customize the content of each section to suit your needs.
+ {.cover}
-Use front matter to define the layout of each section
-::right::
+@dartpad {
+ id: idhere
+ code: ""
+}
-#### Section Options
+@column
-```yaml
-sections:
- left:
- alignment: bottom_right
- flex: 2
- right:
- alignment: bottom_left
- header:
- alignment: bottom_left
-```
-
+## Yes different image{.here}
----
-style: rad
-layout: two_column
-content:
- alignment: center
-sections:
- left:
- right:
- alignment: bottom_left
- flex: 2
---
-# Mix
+@column {
+ align: center_right
+}
-Integration with Mix gives you complete control over all styling elements in your slides with a simple and intuitive API.
+#### Leo Farias
+leoafarias{.here}
-::right::
-```dart
-VariantAttribute get radStyle {
- return const SlideVariant('rad')(
- $.h1.textStyle.as(GoogleFonts.poppins()),
- $.h1.textStyle.fontSize(140),
- $.code.decoration.border.all(
- color: Colors.red,
- width: 3,
- ),
- $.code.decoration(
- color: Colors.black54,
- ),
- $.code.padding.all(40),
-
- $.outerContainer.margin.all(60),
-
- $.innerContainer.borderRadius(25),
- $.innerContainer.shadow(
- blurRadius: 0,
- spreadRadius: 10,
- color: Colors.red.withOpacity(1),
- ),
- $.innerContainer.gradient.radial(
- stops: [0.0, 1.0],
- radius: 0.7,
- colors: [Colors.purple, Colors.deepPurple],
- ),
-
- // Events
- onMouseHover((event) {
- final position = event.position;
- final dx = position.x * 10;
- final dy = position.y * 10;
-
- return Style(
- $.innerContainer.transform(_transformMatrix(position)),
- $.innerContainer.shadow.offset(dx, dy),
- $.innerContainer.gradient.radial(
- center: position,
- ),
- );
- }),
-
- (onPressed | onLongPressed)(
- $.innerContainer.shadow(
- blurRadius: 5,
- spreadRadius: 1,
- offset: Offset.zero,
- color: Colors.purpleAccent,
- ),
- $.innerContainer.border.all(color: Colors.white, width: 1),
- $.innerContainer.gradient.radial
- .colors([Colors.purpleAccent, Colors.purpleAccent]),
- ),
- );
+@column {
+ align: center_left
}
-```
+- Founder/CEO/CTO
+- Open Source Contributor
+- Flutter & Dart GDE
+- Passionate about UI/UX/DX
----
-style: cover
-background: https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGswdWJvY2oxazJoY3g2Y2poNHBvZXlpYmd5YTg0Z2g0ODRrbng4MyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/oB6KlAvOuaLtxYy8l4/giphy.gif
---
-# Markdown support
+@column
+
+@column {
+ align: center_left
+ flex: 2
+}
+> [!WARNING]
+> This presentation contains live AI-generated content. Unexpected things may occur during the demonstration.
+
+@column
----
-style: show_sections
-layout: two_column
-sections:
-content:
- flex: 4
---
-::left::
-**Bold Text**
+@column {
+ flex: 2
+ align: center_right
+}
+### Generative UI
+@column
+## VS
+@column {
+ flex: 2
+}
+### AI Assisted Code Generation
-*Italic Text*
+---
-~~Strikethrough~~
-`Inline Code`
+### What is Generative UI?{.animate}
-[Link here](https://github.com/leoafarias/superdeck)
+@column
-::right::
+- LLMs are great at generating content based on context
+- GUIs are great at providing structured, interactive interfaces for user input and navigation
-Lists
+---
-1. Ordered list item 1
-2. Ordered list item 2
+# LLM ❤️ GUI{.animate}
-- Unordered list item 1
-- Unordered list item 2
-Quotes
+---
-> If you want to go fast, go alone.
-> If you want to go far, go together.
-> ### African Proverb
+@column
+@column {
+ flex: 2
+ align: center
+}
+Creates dynamic, context-aware UIs by interpreting actions and maintaining state with LLMs for fluid, interactive responses.{.animate}
+@column
---
-layout: two_column
+
+### Benefits of UI over Chat{.animate}
+
+- More intuitive and user-friendly, especially for complex tasks
+- Faster feedback loop between users and LLMs
+- Enhances efficiency and interaction
+
---
-::left::
-Code
-```dart
-int factorial(int n) {
- return n == 0 ? 1 : n * factorial(n - 1);
+@column {
+ flex: 3
+ align: center
}
+### Flutter is Well-Suited
for Generative UI
+Built for any screen: Ideal for generating
adaptive UIs across devices and platforms.
+@column
-```
+---
-Tasks
-- [ ] Item 1
-- [x] Item 2
-Subtasks
+## How can LLMs Understtand Your UI?
-- [x] Item 1
- - [ ] Subitem 1
+@column
+
-::right::
-Images
-
+---
+@column
-Table
+### Structured Output
-| Header 1 | Header 2 |
-|----------|----------|
-| Cell 1A | Cell 1B |
-| Cell 2A | Cell 2B |
+@column
+```dart
+final schema = Schema.array(
+ description: 'List of recipes',
+ items: Schema.object(
+ properties: {
+ 'recipeName': Schema.string(
+ description: 'Name of the recipe.',
+ nullable: false,
+ ),
+ },
+ requiredProperties: ['recipeName'],
+ ),
+);
+```
-Divider
+---
-___
+@section
+```dart
+final model = GenerativeModel(
+ model: 'gemini-1.5-pro',
+ apiKey: apiKey,
+ generationConfig: GenerationConfig(
+ responseMimeType: 'application/json',
+ responseSchema: schema,
+ ),
+);
+final prompt = 'List a few popular cookie recipes.';
+final response = await model.generateContent([Content.text(prompt)]);
+
+```
----
-title: "Mermaid example"
-layout: two_column
---
-::left::
+@column
+### Color Palette Generator
-```mermaid
-flowchart TD
- A[This is crazy] -->|Get money| B(Go shopping)
- B --> C{Let me car}
- C -->|One| D[Laptop]
- C -->|Two| E[iPhone]
- C -->|Three| F[fa:fa-car Car]
-```
-
+Generate a color palette based on a given text.
-::right::
+- Name of the palette
+- Font family
+- Font color
+- Color for each corner of the palette
-## Mermaid Support
+---
-Superdeck allows you to use Mermaid diagrams in your slides. It automatically converts the code into a visual representation.
+@column
+```dart
+final schema = Schema.object(properties: {
+ 'name': Schema.string(
+ description:
+ 'The text content to display on color palette. Format: #FF0000',
+ nullable: false,
+ ),
+ 'font': Schema.enumString(
+ enumValues: ColorPaletteFontFamily.enumString,
+ description: 'The font to use for the poster text.',
+ nullable: false,
+ ),
+ 'fontColor': Schema.string(
+ description: 'The hex color value of the poster text. Format: #FF0000',
+ nullable: false,
+ ),
+ 'topLeftColor': Schema.string(
+ description:
+ 'The hex color value top left corner of color palette. Format: #FF0000',
+ nullable: false,
+ ),
+ 'topRightColor': Schema.string(
+ description:
+ 'The hex color value top right corner of color palette. Format: #FF0000',
+ nullable: false,
+ ),
+ 'bottomLeftColor': Schema.string(
+ description:
+ 'The hex color value bottom left corner of color palette. Format: #FF0000',
+ nullable: false,
+ ),
+ 'bottomRightColor': Schema.string(
+ description:
+ 'The hex color value bottom right corner of color palette. Format: #FF0000',
+ nullable: false,
+ )
+}, requiredProperties: [
+ 'name',
+ 'font',
+ 'fontColor',
+ 'topLeftColor',
+ 'topRightColor',
+ 'bottomLeftColor',
+ 'bottomRightColor',
+]);
+
+```
---
-layout: widget
-options:
- name: demo
- args:
- text: Hello, Superdeck!
- height: 200.0
- width: 300.0
+style: demo
---
-## Showcase your widgets
\ No newline at end of file
+@colorPalette {
+ schema: true
+ prompts: [tropical,
+ vibrant, pastel, chocolatey pink unicorn, cyberpunk]
+}
diff --git a/packages/superdeck/example/superdeck.yaml b/packages/superdeck/example/superdeck.yaml
index 26545c0a..e69de29b 100644
--- a/packages/superdeck/example/superdeck.yaml
+++ b/packages/superdeck/example/superdeck.yaml
@@ -1,4 +0,0 @@
-transition:
- type: fade_in
- duration: 0
-
\ No newline at end of file
diff --git a/packages/superdeck/example/windows/flutter/generated_plugin_registrant.cc b/packages/superdeck/example/windows/flutter/generated_plugin_registrant.cc
index 4176f5bc..29ea91d3 100644
--- a/packages/superdeck/example/windows/flutter/generated_plugin_registrant.cc
+++ b/packages/superdeck/example/windows/flutter/generated_plugin_registrant.cc
@@ -8,7 +8,7 @@
#include
#include
-#include
+#include
#include
#include
@@ -17,8 +17,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FileSaverPlugin"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
- ScreenRetrieverPluginRegisterWithRegistrar(
- registry->GetRegistrarForPlugin("ScreenRetrieverPlugin"));
+ ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(
+ registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowManagerPluginRegisterWithRegistrar(
diff --git a/packages/superdeck/example/windows/flutter/generated_plugins.cmake b/packages/superdeck/example/windows/flutter/generated_plugins.cmake
index cfabaeb0..7af4a589 100644
--- a/packages/superdeck/example/windows/flutter/generated_plugins.cmake
+++ b/packages/superdeck/example/windows/flutter/generated_plugins.cmake
@@ -5,7 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
file_saver
file_selector_windows
- screen_retriever
+ screen_retriever_windows
url_launcher_windows
window_manager
)
diff --git a/packages/superdeck/lib/chat/chat_theme.dart b/packages/superdeck/lib/chat/chat_theme.dart
deleted file mode 100644
index 0fbb4e6e..00000000
--- a/packages/superdeck/lib/chat/chat_theme.dart
+++ /dev/null
@@ -1,113 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_chat_ui/flutter_chat_ui.dart';
-
-import '../helpers/extensions.dart';
-
-final _baseTheme = DarkChatTheme();
-
-ChatTheme buildChatTheme(BuildContext context) {
- return DarkChatTheme(
- backgroundColor: context.colorScheme.surface,
- inputSurfaceTintColor: Colors.black,
- dateDividerTextStyle: TextStyle(
- color: context.colorScheme.onSurface,
- fontSize: 12,
- fontWeight: FontWeight.w800,
- height: 1.333,
- ),
- emptyChatPlaceholderTextStyle: TextStyle(
- color: context.colorScheme.onSurface.withOpacity(0.6),
- fontSize: 16,
- fontWeight: FontWeight.w500,
- height: 1.5,
- ),
- errorColor: context.colorScheme.error,
- inputBackgroundColor: Colors.black,
- inputBorderRadius: BorderRadius.zero,
- inputTextColor: context.colorScheme.onSurface,
- primaryColor: context.colorScheme.primary,
- receivedMessageBodyTextStyle: TextStyle(
- color: context.colorScheme.onSecondary,
- fontSize: 16,
- fontWeight: FontWeight.w500,
- height: 1.5,
- ),
- receivedMessageCaptionTextStyle: TextStyle(
- color: context.colorScheme.onSecondary.withOpacity(0.6),
- fontSize: 12,
- fontWeight: FontWeight.w500,
- height: 1.333,
- ),
- receivedMessageDocumentIconColor: context.colorScheme.primary,
- receivedMessageLinkDescriptionTextStyle: TextStyle(
- color: context.colorScheme.onSecondary,
- fontSize: 14,
- fontWeight: FontWeight.w400,
- height: 1.428,
- ),
- receivedMessageLinkTitleTextStyle: TextStyle(
- color: context.colorScheme.onSecondary,
- fontSize: 16,
- fontWeight: FontWeight.w800,
- height: 1.375,
- ),
- secondaryColor: context.colorScheme.secondary,
- sentMessageBodyTextStyle: TextStyle(
- color: context.colorScheme.onPrimary,
- fontSize: 16,
- fontWeight: FontWeight.w500,
- height: 1.5,
- ),
- sentMessageCaptionTextStyle: TextStyle(
- color: context.colorScheme.onPrimary.withOpacity(0.6),
- fontSize: 12,
- fontWeight: FontWeight.w500,
- height: 1.333,
- ),
- sentMessageDocumentIconColor: context.colorScheme.onPrimary,
- sentMessageLinkDescriptionTextStyle: TextStyle(
- color: context.colorScheme.onPrimary,
- fontSize: 14,
- fontWeight: FontWeight.w400,
- height: 1.428,
- ),
- sentMessageLinkTitleTextStyle: TextStyle(
- color: context.colorScheme.onPrimary,
- fontSize: 16,
- fontWeight: FontWeight.w800,
- height: 1.375,
- ),
- // systemMessageTheme: SystemMessageTheme(
- // textStyle: TextStyle(
- // color: context.colorScheme.onSurface,
- // fontSize: 12,
- // fontWeight: FontWeight.w800,
- // height: 1.333,
- // ),
- // ),
- // typingIndicatorTheme: TypingIndicatorTheme(
- // animatedCirclesColor: context.colorScheme.onSurface,
- // bubbleColor: context.colorScheme.surface,
- // countTextColor: context.colorScheme.onPrimary,
- // animatedCircleSize: _baseTheme.typingIndicatorTheme.animatedCircleSize,
- // bubbleBorder: _baseTheme.typingIndicatorTheme.bubbleBorder,
- // countAvatarColor: context.colorScheme.primary,
- // multipleUserTextStyle: context.textTheme.bodySmall!,
- // ),
- unreadHeaderTheme: UnreadHeaderTheme(
- color: context.colorScheme.secondary,
- textStyle: TextStyle(
- color: context.colorScheme.onSecondary.withOpacity(0.6),
- fontSize: 12,
- fontWeight: FontWeight.w500,
- height: 1.333,
- ),
- ),
- userAvatarTextStyle: TextStyle(
- color: context.colorScheme.onPrimary,
- fontSize: 12,
- fontWeight: FontWeight.w800,
- height: 1.333,
- ),
- );
-}
diff --git a/packages/superdeck/lib/chat/components/typing_indicator.dart b/packages/superdeck/lib/chat/components/typing_indicator.dart
deleted file mode 100644
index 14d3c0c2..00000000
--- a/packages/superdeck/lib/chat/components/typing_indicator.dart
+++ /dev/null
@@ -1,66 +0,0 @@
-import 'dart:async';
-
-import 'package:flutter/material.dart';
-
-class WaitingIndicator extends StatefulWidget {
- final bool isTyping;
-
- const WaitingIndicator({Key? key, required this.isTyping}) : super(key: key);
-
- @override
- State createState() => _WaitingIndicatorState();
-}
-
-class _WaitingIndicatorState extends State {
- late Timer _timer;
- final List _dotSizes = [6, 8, 10];
-
- @override
- void initState() {
- super.initState();
- _startTimer();
- }
-
- @override
- void dispose() {
- _stopTimer();
- super.dispose();
- }
-
- void _startTimer() {
- _timer = Timer.periodic(const Duration(milliseconds: 500), (_) {
- setState(() {
- _dotSizes.insert(0, _dotSizes.removeLast());
- });
- });
- }
-
- void _stopTimer() {
- _timer.cancel();
- }
-
- @override
- Widget build(BuildContext context) {
- return widget.isTyping
- ? Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- for (final size in _dotSizes)
- Padding(
- padding: const EdgeInsets.only(right: 4),
- child: AnimatedContainer(
- duration: const Duration(milliseconds: 500),
- curve: Curves.easeInOut,
- height: size,
- width: size,
- decoration: BoxDecoration(
- shape: BoxShape.circle,
- color: Colors.grey[400],
- ),
- ),
- ),
- ],
- )
- : const SizedBox.shrink();
- }
-}
diff --git a/packages/superdeck/lib/chat/prompt.dart b/packages/superdeck/lib/chat/prompt.dart
deleted file mode 100644
index feb031d7..00000000
--- a/packages/superdeck/lib/chat/prompt.dart
+++ /dev/null
@@ -1,64 +0,0 @@
-final presentationAssistantPrompt = '''
-
-
-
-**CONTEXT:**
-
-You are a markdown presentation assistance bot designed to help users create, refine, and optimize markdown-based slides. Users often use frontmatter to define styles, layouts, and various options within their presentations. Your task is to assist in adjusting these elements to improve the overall presentation while providing feedback and suggestions on specific slide numbers.
-
-**OBJECTIVE:**
-
-To guide users in enhancing their markdown presentations by suggesting improvements to the structure, layout, and style. When proposing changes, you should clearly reference the slide number where the change is suggested. Additionally, ensure that the user is aware of available frontmatter options that can be utilized for better customization.
-
-**STYLE:**
-Never change the frontmatter structure, or any of the image urls.
-Always focus on one specific slide and fixes before moving to the next changes.
-Provide feedback in a concise and instructional manner, ensuring that each suggestion is actionable. The feedback should focus on optimizing the presentation's readability, visual appeal, and effectiveness in conveying the intended message.
-
-**TONE:**
-
-Professional and supportive. Encourage the user by acknowledging their current efforts and offering constructive advice to elevate the presentation.
-
-**AUDIENCE:**
-
-The audience comprises users who are actively working on creating markdown-based presentations. They may have varying levels of experience with markdown and frontmatter customization, so explanations should be clear and accessible.
-
-**REQUIRED FORMAT:**
-
-The suggestions are always conversational, you should should not provide code snippets.
-Feedback and suggestions should be provided as text responses within the markdown file or as separate comments. Each suggestion must include a reference to the specific slide number being discussed.
-
-**STEP-BACK PROMPTING:**
-
-Before making specific suggestions, review the overall structure and style of the presentation. Consider the flow and coherence of the slides, as well as the effective use of frontmatter for layout and style consistency. Are there opportunities to better utilize frontmatter options to enhance the presentation's impact?
-
-**END RESULT PROMPTING:**
-
-Envision the final version of the markdown presentation after all suggested changes have been implemented. Describe how the presentation has improved in terms of clarity, visual appeal, and audience engagement. What specific changes have made the most significant impact, and how does the presentation now meet the user's original goals?
-''';
-
-final provideMarkdownEdits = '''
-CONTEXT:
-You need a finalized Markdown document incorporating all feedback and ready for immediate use, without extra lines or spaces, or extra content in the response.
-
-OBJECTIVE:
-Deliver a fully edited, complete Markdown file, ready to save and use with no further adjustments.
-
-STYLE:
-Clear, concise, and well-structured, with a focus on precision.
-
-TONE:
-Professional and straightforward, reflecting previous feedback.
-
-AUDIENCE:
-Intended for immediate use by professionals needing the finalized content.
-
-REQUIRED FORMAT:
-A complete and polished Markdown file, ready for saving.
-
-STEP-BACK PROMPTING:
-Review the Markdown file to ensure all feedback is integrated and the content is complete and aligned with clarity goals.
-
-END RESULT PROMPTING:
-Envision saving the file as the final version, reflecting all edits and ready for immediate use with no further modifications needed.
-''';
diff --git a/packages/superdeck/lib/components/atoms/cache_image_widget.dart b/packages/superdeck/lib/components/atoms/cache_image_widget.dart
deleted file mode 100644
index fd9ba9fe..00000000
--- a/packages/superdeck/lib/components/atoms/cache_image_widget.dart
+++ /dev/null
@@ -1,103 +0,0 @@
-import 'dart:io';
-import 'dart:math';
-
-import 'package:cached_network_image/cached_network_image.dart';
-import 'package:collection/collection.dart';
-import 'package:flutter/material.dart';
-
-import '../../helpers/constants.dart';
-import '../../superdeck.dart';
-
-class CacheImage extends StatelessWidget {
- final String url;
- final BoxFit? fit;
- final ImageSpec spec;
- final Alignment? alignment;
-
- const CacheImage({
- required this.url,
- this.fit = BoxFit.cover,
- this.alignment = Alignment.center,
- this.spec = const ImageSpec(),
- super.key,
- });
-
- @override
- Widget build(BuildContext context) {
- return AnimatedImageSpecWidget(
- image: getImageProvider(url),
- spec: spec.copyWith(
- fit: fit,
- alignment: alignment,
- ),
- );
- }
-}
-
-({int? width, int? height}) calculateImageSize(Size size, SlideAsset? asset) {
- int? cacheWidth;
- int? cacheHeight;
- // check if height or asset is larger
- if (asset != null) {
- // cache the smallest dimension of the image
- // So set the other dimension to null
- if (asset.isPortrait) {
- cacheHeight = min(size.height, asset.height).toInt();
- } else {
- cacheWidth = min(size.width, asset.width).toInt();
- }
- } else {
- // If no asset is available, set both cacheWidth and cacheHeight
- final ifHeightIsBigger = size.height > size.width;
-
-// cache the smallest
- if (ifHeightIsBigger) {
- cacheWidth = size.width.toInt();
- } else {
- cacheHeight = size.height.toInt();
- }
- }
-
- return (width: cacheWidth, height: cacheHeight);
-}
-
-ImageProvider getImageProvider(String url, {Size? targetSize}) {
- ImageProvider provider;
-
- final assets = $superdeck.assets;
-
- final assetUrl = assets.firstWhereOrNull((e) {
- if (e.path == url) {
- return true;
- }
-
- if (e.reference == url) {
- return true;
- }
-
- return false;
- });
-
- url = assetUrl?.path ?? url;
-
- // check if its a local path or a network path
- if (url.startsWith('http')) {
- provider = CachedNetworkImageProvider(url);
- } else {
- if (kCanRunProcess) {
- final file = File(url);
- provider = FileImage(file);
- } else {
- provider = AssetImage(url);
- }
- }
-
- final (:width, :height) =
- calculateImageSize(targetSize ?? kResolution, assetUrl);
-
- return ResizeImage.resizeIfNeeded(
- width,
- height,
- provider,
- );
-}
diff --git a/packages/superdeck/lib/components/atoms/linear_progresss_indicator_widget.dart b/packages/superdeck/lib/components/atoms/linear_progresss_indicator_widget.dart
deleted file mode 100644
index f2f9564d..00000000
--- a/packages/superdeck/lib/components/atoms/linear_progresss_indicator_widget.dart
+++ /dev/null
@@ -1,37 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-
-class AnimatedLinearProgressIndicator extends HookWidget {
- final double progress;
-
- const AnimatedLinearProgressIndicator({
- super.key,
- required this.progress,
- });
-
- @override
- Widget build(BuildContext context) {
- final animationController = useAnimationController(
- duration: const Duration(milliseconds: 100),
- );
-
- final animation =
- Tween(begin: 0.0, end: progress).animate(animationController);
-
- useEffect(() {
- animationController.forward();
- return null;
- }, []);
-
- return AnimatedBuilder(
- animation: animation,
- builder: (context, child) {
- return LinearProgressIndicator(
- minHeight: 10,
- borderRadius: BorderRadius.circular(10),
- value: animation.value,
- );
- },
- );
- }
-}
diff --git a/packages/superdeck/lib/components/atoms/markdown_viewer.dart b/packages/superdeck/lib/components/atoms/markdown_viewer.dart
deleted file mode 100644
index a23b7957..00000000
--- a/packages/superdeck/lib/components/atoms/markdown_viewer.dart
+++ /dev/null
@@ -1,230 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_markdown/flutter_markdown.dart';
-import 'package:markdown/markdown.dart' as md;
-
-import '../../helpers/constants.dart';
-import '../../helpers/measure_size.dart';
-import '../../helpers/syntax_highlighter.dart';
-import '../../helpers/utils.dart';
-import '../../superdeck.dart';
-import 'cache_image_widget.dart';
-
-class AnimatedMarkdownViewer extends ImplicitlyAnimatedWidget {
- final String content;
- final SlideSpec spec;
-
- const AnimatedMarkdownViewer({
- super.key,
- required this.content,
- required this.spec,
- required super.duration,
- super.curve = Curves.linear,
- });
-
- @override
- ImplicitlyAnimatedWidgetState createState() =>
- _AnimatedMarkdownViewerState();
-}
-
-class _AnimatedMarkdownViewerState
- extends AnimatedWidgetBaseState {
- SlideSpecTween? _styleTween;
- Size? _size;
-
- @override
- void forEachTween(TweenVisitor visitor) {
- _styleTween = visitor(
- _styleTween,
- widget.spec,
- (dynamic value) => SlideSpecTween(begin: value),
- ) as SlideSpecTween?;
- }
-
- @override
- Widget build(BuildContext context) {
- final spec = _styleTween!.evaluate(animation) ?? const SlideSpec();
- return MeasureSingleWidgetSize(
- onChange: (size) {
- setState(() {
- _size = size;
- });
- },
- child: MarkdownBody(
- data: widget.content,
- extensionSet: md.ExtensionSet(
- md.ExtensionSet.gitHubFlavored.blockSyntaxes,
- [
- md.EmojiSyntax(),
- ...md.ExtensionSet.gitHubFlavored.inlineSyntaxes
- ],
- ),
- imageBuilder: (uri, title, alt) {
- return _imageBuilder(uri, title, alt, size: _size ?? kResolution);
- },
- builders: {
- 'code': CodeElementBuilder(spec.code),
- },
- bulletBuilder: (parameters) {
- if (parameters.style == BulletStyle.orderedList) {
- final index = parameters.index + 1;
- return Text(
- '$index .',
- style: spec.list?.bulletStyle,
- );
- } else {
- return Text('•', style: spec.list?.bulletStyle);
- }
- },
- styleSheet: _styleTween!.evaluate(animation)?.toStyle(),
- ),
- );
- }
-}
-
-List updateTextColor(
- List originalSpans,
- List targetLines,
- Color newColor,
-) {
- // Check if the target line is within the range of the list
- if (targetLines.isEmpty) {
- return originalSpans;
- }
-
- // Clone the original list to avoid mutating it directly
- List updatedSpans = List.from(originalSpans);
-
- // Detect line break from the list of text spans
- // This is done by checking if the previous span is a line break
- // If it is, then the current span is the start of a new line
- int line = 1;
-
- for (int i = 0; i < updatedSpans.length; i++) {
- if (i > 0) {
- final currentValue = updatedSpans[i].text ?? '';
-
- if (currentValue.startsWith('\n')) {
- line++;
- }
- }
- final originalSpan = originalSpans[i];
-
- final textStyle = originalSpan.style ?? const TextStyle();
-
- if (targetLines.contains(line)) {
- updatedSpans[i] = TextSpan(
- text: originalSpan.text,
- children: originalSpan.children,
- recognizer: originalSpan.recognizer,
- mouseCursor: originalSpan.mouseCursor,
- onEnter: originalSpan.onEnter,
- onExit: originalSpan.onExit,
- semanticsLabel: originalSpan.semanticsLabel,
- locale: originalSpan.locale,
- spellOut: originalSpan.spellOut,
- style: textStyle.copyWith(
- backgroundColor: newColor,
- ),
- );
- }
- }
-
- return updatedSpans;
-}
-
-Widget _imageBuilder(
- Uri uri,
- String? title,
- String? alt, {
- required Size size,
-}) {
- return Builder(builder: (context) {
- final slideSpec = SlideSpec.of(context);
-
- return ConstrainedBox(
- constraints: calculateConstraints(size, slideSpec),
- child: CacheImage(
- url: uri.toString(),
- spec: slideSpec.image,
- ),
- );
- });
-}
-
-class TextBuilder extends MarkdownElementBuilder {
- final TextSpec? spec;
- TextBuilder(this.spec);
- @override
- Widget visitText(md.Text text, TextStyle? preferredStyle) {
- return TextSpecWidget(text.text, spec: spec);
- }
-}
-
-class CodeElementBuilder extends MarkdownElementBuilder {
- final MdCodeblockSpec? spec;
- CodeElementBuilder(this.spec);
- @override
- Widget? visitElementAfter(md.Element element, TextStyle? preferredStyle) {
- var language = 'dart';
-
- if (element.attributes['class'] != null) {
- String lg = element.attributes['class'] as String;
- language = lg.substring(9);
- }
- return Row(
- children: [
- Expanded(
- child: Container(
- padding: spec?.padding,
- decoration: spec?.decoration,
- child: RichText(
- text: TextSpan(
- style: spec?.textStyle,
- children: SyntaxHighlight.render(
- element.textContent.trim(),
- language,
- ),
- ),
- ),
- ),
- ),
- ],
- );
- }
-}
-
-class SampleCodeElementBuilder extends MarkdownElementBuilder {
- final MdCodeblockSpec? spec;
- SampleCodeElementBuilder(this.spec);
- @override
- Widget? visitElementAfter(md.Element element, TextStyle? preferredStyle) {
- var language = 'dart';
-
- if (element.attributes['class'] != null) {
- String lg = element.attributes['class'] as String;
- language = lg.substring(9);
- }
- return Row(
- children: [
- Expanded(
- child: Container(
- padding: EdgeInsets.all(8),
- decoration: BoxDecoration(
- color: Colors.transparent,
- borderRadius: BorderRadius.circular(8),
- ),
- child: RichText(
- text: TextSpan(
- style: spec?.textStyle,
- children: SyntaxHighlight.render(
- element.textContent.trim(),
- language,
- ),
- ),
- ),
- ),
- ),
- ],
- );
- }
-}
diff --git a/packages/superdeck/lib/components/atoms/sized_transition.dart b/packages/superdeck/lib/components/atoms/sized_transition.dart
deleted file mode 100644
index 9f203265..00000000
--- a/packages/superdeck/lib/components/atoms/sized_transition.dart
+++ /dev/null
@@ -1,37 +0,0 @@
-import 'dart:math' as math;
-
-import 'package:flutter/widgets.dart';
-
-class SizedTransition extends StatelessWidget {
- const SizedTransition({
- super.key,
- required this.sizeFactor,
- this.child,
- this.direction = Axis.horizontal,
- });
-
- final double sizeFactor;
- final Axis direction;
-
- final Widget? child;
-
- @override
- Widget build(BuildContext context) {
- AlignmentDirectional alignment;
- if (direction == Axis.horizontal) {
- alignment = const AlignmentDirectional(0.0, -1.0);
- } else {
- alignment = const AlignmentDirectional(-1.0, 0.0);
- }
- return ClipRect(
- child: Align(
- alignment: alignment,
- heightFactor:
- direction == Axis.vertical ? math.max(sizeFactor, 0.0) : 1.0,
- widthFactor:
- direction == Axis.horizontal ? math.max(sizeFactor, 0.0) : 1.0,
- child: child,
- ),
- );
- }
-}
diff --git a/packages/superdeck/lib/components/atoms/slide_thumbnail.dart b/packages/superdeck/lib/components/atoms/slide_thumbnail.dart
deleted file mode 100644
index ab338f65..00000000
--- a/packages/superdeck/lib/components/atoms/slide_thumbnail.dart
+++ /dev/null
@@ -1,153 +0,0 @@
-import 'dart:async';
-import 'dart:io';
-
-import 'package:flutter/material.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:remix/remix.dart';
-
-import '../../helpers/constants.dart';
-import '../../helpers/extensions.dart';
-import '../../services/reference_service.dart';
-import '../../services/snapshot_service.dart';
-import '../../superdeck.dart';
-import 'cache_image_widget.dart';
-import 'loading_indicator.dart';
-
-class SlideThumbnail extends HookWidget {
- final VoidCallback onTap;
- final bool selected;
- final Slide slide;
- final int page;
-
- const SlideThumbnail({
- super.key,
- required this.selected,
- required this.onTap,
- required this.slide,
- required this.page,
- });
-
- @override
- Widget build(BuildContext context) {
- final processThumbnail = useFuture(
- useMemoized(() => _generateThumbnail(slide, context), [slide]),
- );
- return LayoutBuilder(builder: (context, constraints) {
- final child = processThumbnail.when(
- data: (file) {
- return Image(
- gaplessPlayback: true,
- image: getImageProvider(file.path),
- );
- },
- loading: () {
- return IsometricLoading();
- },
- error: (error, _) {
- return const Center(
- child: Text('Error loading image'),
- );
- },
- );
-
- return GestureDetector(
- onTap: onTap,
- child: _PreviewContainer(
- selected: selected,
- child: AspectRatio(
- aspectRatio: kAspectRatio,
- child: Stack(
- children: [
- AspectRatio(
- aspectRatio: kAspectRatio,
- child: child,
- ),
- Positioned(
- top: 0,
- right: 0,
- left: 0,
- child: SizedBox(
- child: processThumbnail.isRefreshing
- ? const LinearProgressIndicator(
- minHeight: 3,
- backgroundColor: Colors.transparent,
- )
- : null,
- ),
- ),
- Positioned(
- right: 0,
- bottom: 0,
- child: Container(
- padding: const EdgeInsets.fromLTRB(12, 4, 12, 4),
- color: Colors.black.withOpacity(0.9),
- child: Text(
- '$page',
- style: const TextStyle(
- color: Colors.white,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- );
- });
- }
-}
-
-class _PreviewContainer extends StatelessWidget {
- final Widget child;
- final bool selected;
-
- const _PreviewContainer({
- required this.selected,
- required this.child,
- });
-
- @override
- Widget build(BuildContext context) {
- final style = Style(
- $box.color.$neutral(2),
- $box.margin.all(8),
- $box.border.width(2),
- $box.shadow(
- blurRadius: 4,
- spreadRadius: 1,
- ),
-
- selected ? $box.wrap.scale(1.05) : $box.wrap.scale(1),
- selected ? $box.wrap.opacity(1) : $box.wrap.opacity(0.5),
- selected ? $box.border.color.$accent() : $box.border.color.transparent(),
- // $on.hover(
- // $box.wrap.opacity(1),
- // ),
- ).animate();
-
- return Box(
- style: style,
- child: child,
- );
- }
-}
-
-Future _generateThumbnail(Slide slide, BuildContext context) async {
- final thumbnailFile =
- ReferenceService.instance.getAssetFile('thumbnail_${slide.key}.png');
-
- if (!kCanRunProcess || await thumbnailFile.exists()) {
- return thumbnailFile;
- }
-
- final imageData = await SnapshotService.instance.generate(
- quality: SnapshotQuality.low,
- slide: slide,
- );
-
- await thumbnailFile.writeAsBytes(imageData);
-
- return thumbnailFile;
-}
diff --git a/packages/superdeck/lib/components/atoms/slide_view.dart b/packages/superdeck/lib/components/atoms/slide_view.dart
deleted file mode 100644
index 1561225c..00000000
--- a/packages/superdeck/lib/components/atoms/slide_view.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-import 'package:flutter/material.dart';
-
-import '../../providers/slide_provider.dart';
-import '../../providers/snapshot_provider.dart';
-import '../../providers/style_provider.dart';
-import '../../superdeck.dart';
-import 'cache_image_widget.dart';
-import 'transition_widget.dart';
-
-class SlideView extends StatelessWidget {
- const SlideView(
- this.slide, {
- super.key,
- });
-
- final T slide;
-
- @override
- Widget build(BuildContext context) {
- final slide = this.slide;
-
- final variantStyle = StyleProvider.of(context, slide.style);
-
- final isCapturing = SnapshotProvider.isCapturingOf(context);
- final duration =
- isCapturing ? Duration.zero : const Duration(milliseconds: 300);
-
- final backgroundWidget = slide.background != null
- ? CacheImage(
- url: slide.background!,
- fit: BoxFit.cover,
- alignment: Alignment.center,
- )
- : const SizedBox();
-
- return TransitionWidget(
- key: ValueKey(slide.transition),
- transition: slide.transition,
- child: SpecBuilder(
- style: variantStyle,
- builder: (context) {
- final spec = SlideSpec.of(context);
- return Builder(builder: (context) {
- return AnimatedBoxSpecWidget(
- spec: spec.outerContainer,
- duration: duration,
- child: Stack(
- children: [
- Positioned.fill(child: backgroundWidget),
- AnimatedBoxSpecWidget(
- spec: spec.innerContainer,
- duration: duration,
- child: SlideBuilder(slide),
- ),
- ],
- ),
- );
- });
- },
- ),
- );
- }
-}
diff --git a/packages/superdeck/lib/components/atoms/transition_widget.dart b/packages/superdeck/lib/components/atoms/transition_widget.dart
deleted file mode 100644
index a6ec5d73..00000000
--- a/packages/superdeck/lib/components/atoms/transition_widget.dart
+++ /dev/null
@@ -1,176 +0,0 @@
-import 'package:animate_do/animate_do.dart';
-import 'package:flutter/material.dart';
-
-import '../../models/options_model.dart';
-
-class TransitionWidget extends StatelessWidget {
- final TransitionOptions? transition;
- final Widget child;
-
- const TransitionWidget({
- super.key,
- required this.transition,
- required this.child,
- });
-
- @override
- Widget build(BuildContext context) {
- final duration = transition?.duration ?? const Duration(milliseconds: 500);
- final delay = transition?.delay ?? const Duration(milliseconds: 0);
- final curve = _getCurveFromType(transition?.curve) ?? Curves.easeInOut;
- final type = transition?.type;
-
- if (type == null) return child;
-
- final buildAnimation = _getWidgetByType(type);
- return Container(
- child: buildAnimation(
- duration: duration,
- delay: delay,
- curve: curve,
- child: child,
- ),
- );
- }
-}
-
-Curve? _getCurveFromType(CurveType? curveType) {
- switch (curveType) {
- case CurveType.easeInOut:
- return Curves.easeInOut;
- case CurveType.easeIn:
- return Curves.easeIn;
- case CurveType.easeOut:
- return Curves.easeOut;
- case CurveType.linear:
- return Curves.linear;
- case CurveType.decelerate:
- return Curves.decelerate;
- case CurveType.fastLinearToSlowEaseIn:
- return Curves.fastLinearToSlowEaseIn;
- case CurveType.bounceIn:
- return Curves.bounceIn;
- case CurveType.bounceOut:
- return Curves.bounceOut;
- case CurveType.elasticIn:
- return Curves.elasticIn;
- case CurveType.elasticOut:
- return Curves.elasticOut;
- case CurveType.elasticInOut:
- return Curves.elasticInOut;
- case CurveType.fastOutSlowIn:
- return Curves.fastOutSlowIn;
- case CurveType.slowMiddle:
- return Curves.slowMiddle;
- case CurveType.linearToEaseOut:
- return Curves.linearToEaseOut;
- case CurveType.ease:
- return Curves.ease;
- default:
- return null;
- }
-}
-
-Widget Function({
- required Duration duration,
- required Duration delay,
- required Curve curve,
- required Widget child,
-}) _getWidgetByType(
- TransitionType type,
-) {
- switch (type) {
- case TransitionType.fadeIn:
- return FadeIn.new;
- case TransitionType.fadeInDown:
- return FadeInDown.new;
- case TransitionType.fadeInDownBig:
- return FadeInDownBig.new;
- case TransitionType.fadeInUp:
- return FadeInUp.new;
- case TransitionType.fadeInUpBig:
- return FadeInUpBig.new;
- case TransitionType.fadeInLeft:
- return FadeInLeft.new;
- case TransitionType.fadeInLeftBig:
- return FadeInLeftBig.new;
- case TransitionType.fadeInRight:
- return FadeInRight.new;
- case TransitionType.fadeInRightBig:
- return FadeInRightBig.new;
- case TransitionType.fadeOut:
- return FadeOut.new;
- case TransitionType.fadeOutDown:
- return FadeOutDown.new;
- case TransitionType.fadeOutDownBig:
- return FadeOutDownBig.new;
- case TransitionType.fadeOutUp:
- return FadeOutUp.new;
- case TransitionType.fadeOutUpBig:
- return FadeOutUpBig.new;
- case TransitionType.fadeOutLeft:
- return FadeOutLeft.new;
- case TransitionType.fadeOutLeftBig:
- return FadeOutLeftBig.new;
- case TransitionType.fadeOutRight:
- return FadeOutRight.new;
- case TransitionType.fadeOutRightBig:
- return FadeOutRightBig.new;
- case TransitionType.bounceInDown:
- return BounceInDown.new;
- case TransitionType.bounceInUp:
- return BounceInUp.new;
- case TransitionType.bounceInLeft:
- return BounceInLeft.new;
- case TransitionType.bounceInRight:
- return BounceInRight.new;
- case TransitionType.elasticIn:
- return ElasticIn.new;
- case TransitionType.elasticInDown:
- return ElasticInDown.new;
- case TransitionType.elasticInUp:
- return ElasticInUp.new;
- case TransitionType.elasticInLeft:
- return ElasticInLeft.new;
- case TransitionType.elasticInRight:
- return ElasticInRight.new;
- case TransitionType.slideInDown:
- return SlideInDown.new;
- case TransitionType.slideInUp:
- return SlideInUp.new;
- case TransitionType.slideInLeft:
- return SlideInLeft.new;
- case TransitionType.slideInRight:
- return SlideInRight.new;
- case TransitionType.flipInX:
- return FlipInX.new;
- case TransitionType.flipInY:
- return FlipInY.new;
- case TransitionType.zoomIn:
- return ZoomIn.new;
- case TransitionType.zoomOut:
- return ZoomOut.new;
- case TransitionType.jelloIn:
- return JelloIn.new;
- case TransitionType.bounce:
- return Bounce.new;
- case TransitionType.dance:
- return Dance.new;
- case TransitionType.flash:
- return Flash.new;
- case TransitionType.pulse:
- return Pulse.new;
- case TransitionType.roulette:
- return Roulette.new;
- case TransitionType.shakeX:
- return ShakeX.new;
- case TransitionType.shakeY:
- return ShakeY.new;
- case TransitionType.spin:
- return Spin.new;
- case TransitionType.spinPerfect:
- return SpinPerfect.new;
- case TransitionType.swing:
- return Swing.new;
- }
-}
diff --git a/packages/superdeck/lib/components/molecules/code_preview.dart b/packages/superdeck/lib/components/molecules/code_preview.dart
deleted file mode 100644
index 453a4ee8..00000000
--- a/packages/superdeck/lib/components/molecules/code_preview.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-import 'package:flutter/foundation.dart';
-import 'package:flutter/material.dart';
-
-class ExamplePreview extends StatelessWidget {
- const ExamplePreview({
- super.key,
- required this.args,
- required this.builder,
- });
-
- final Map args;
-
- final Widget Function(BuildContext) builder;
-
- @override
- Widget build(BuildContext context) {
- return ExampleArgsProvider(
- args: args,
- child: Center(
- child: Builder(builder: builder),
- ),
- );
- }
-}
-
-extension BuildContextExampleX on BuildContext {
- Map get args {
- return ExampleArgsProvider.of(this);
- }
-}
-
-class ExampleArgsProvider extends InheritedWidget {
- const ExampleArgsProvider({
- required this.args,
- required super.child,
- super.key,
- });
-
- final Map args;
-
- static Map of(BuildContext context) {
- final provider =
- context.dependOnInheritedWidgetOfExactType();
- return provider?.args ?? {};
- }
-
- @override
- bool updateShouldNotify(ExampleArgsProvider oldWidget) {
- return !mapEquals(args, oldWidget.args);
- }
-}
diff --git a/packages/superdeck/lib/components/molecules/exception_widget.dart b/packages/superdeck/lib/components/molecules/exception_widget.dart
deleted file mode 100644
index 49c57ae2..00000000
--- a/packages/superdeck/lib/components/molecules/exception_widget.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-import 'package:flutter/material.dart';
-
-class ExceptionWidget extends StatelessWidget {
- final Object? error;
- const ExceptionWidget(this.error, {super.key, required this.onRetry});
-
- final void Function() onRetry;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- const Text('An error occurred'),
- Text(error.toString()),
- const SizedBox(height: 20),
- ElevatedButton(
- onPressed: onRetry,
- child: const Text('Retry'),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/packages/superdeck/lib/components/molecules/navigation_rail.dart b/packages/superdeck/lib/components/molecules/navigation_rail.dart
deleted file mode 100644
index fc65f8dd..00000000
--- a/packages/superdeck/lib/components/molecules/navigation_rail.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:mix/mix.dart';
-
-import '../remix/button.dart';
-
-class CustomNavigationRail extends HookWidget {
- final int selectedIndex;
- final ValueChanged? onDestinationSelected;
- final List destinations;
- final bool displayLabel;
- final double? leading;
- final double? trailing;
-
- CustomNavigationRail({
- required this.selectedIndex,
- this.onDestinationSelected,
- required this.destinations,
- this.displayLabel = false,
- this.leading,
- this.trailing,
- });
-
- @override
- Widget build(BuildContext context) {
- final _buildDestination = useCallback((int index) {
- final destination = destinations[index];
- final isSelected = selectedIndex == index;
-
- return Padding(
- padding: const EdgeInsets.symmetric(vertical: 4),
- child: SDIconButton(
- icon: destination.icon,
- onPressed: () => onDestinationSelected?.call(index),
- selected: isSelected,
- ),
- );
- }, [selectedIndex, destinations]);
-
- return VBox(
- style: _containerStyle,
- children: [
- if (leading != null) SizedBox(height: leading),
- for (int i = 0; i < destinations.length; i++) _buildDestination(i),
- if (trailing != null) SizedBox(height: trailing),
- ],
- );
- }
-}
-
-get _containerStyle => Style(
- $box.color.black(),
- $box.padding(16),
- $box.border.right(
- color: Colors.white10,
- width: 1,
- ),
- );
-
-class CustomNavigationRailDestination {
- final IconData icon;
- final String label;
-
- CustomNavigationRailDestination({
- required this.icon,
- required this.label,
- });
-}
diff --git a/packages/superdeck/lib/components/molecules/slide_content.dart b/packages/superdeck/lib/components/molecules/slide_content.dart
deleted file mode 100644
index da50a9ef..00000000
--- a/packages/superdeck/lib/components/molecules/slide_content.dart
+++ /dev/null
@@ -1,52 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:mix/mix.dart';
-
-import '../../models/options_model.dart';
-import '../../providers/snapshot_provider.dart';
-import '../../styles/style_spec.dart';
-import '../atoms/markdown_viewer.dart';
-
-class SlideContent extends StatelessWidget {
- const SlideContent({
- required this.content,
- required this.options,
- super.key,
- });
-
- final String content;
-
- final ContentOptions? options;
-
- @override
- Widget build(context) {
- final alignment = options?.alignment ?? ContentAlignment.center;
- final spec = SlideSpec.of(context);
- final isCapturing = SnapshotProvider.isCapturingOf(context);
-
- Widget child = AnimatedMarkdownViewer(
- content: content,
- spec: spec,
- duration: Durations.medium1,
- );
-
- if (!isCapturing) {
- child = SingleChildScrollView(
- child: child,
- );
- } else {
- child = Wrap(
- clipBehavior: Clip.hardEdge,
- children: [
- child,
- ],
- );
- }
- return AnimatedBoxSpecWidget(
- duration: const Duration(milliseconds: 300),
- spec: spec.contentContainer.copyWith(
- alignment: alignment.toAlignment(),
- ),
- child: child,
- );
- }
-}
diff --git a/packages/superdeck/lib/components/molecules/slide_preview.dart b/packages/superdeck/lib/components/molecules/slide_preview.dart
deleted file mode 100644
index c3fef6ec..00000000
--- a/packages/superdeck/lib/components/molecules/slide_preview.dart
+++ /dev/null
@@ -1,35 +0,0 @@
-import 'package:flutter/material.dart';
-
-import '../../superdeck.dart';
-import '../atoms/slide_view.dart';
-import 'scaled_app.dart';
-
-class SlidePreview extends StatelessWidget {
- const SlidePreview(
- this.slide, {
- super.key,
- });
-
- final T slide;
-
- @override
- Widget build(BuildContext context) {
- return Center(
- child: Container(
- decoration: BoxDecoration(
- color: const Color.fromARGB(255, 68, 60, 60),
- boxShadow: [
- BoxShadow(
- color: Colors.black.withOpacity(0.3),
- blurRadius: 6,
- spreadRadius: 3,
- ),
- ],
- ),
- child: ScaledWidget(
- child: SlideView(slide),
- ),
- ),
- );
- }
-}
diff --git a/packages/superdeck/lib/components/molecules/split_view.dart b/packages/superdeck/lib/components/molecules/split_view.dart
deleted file mode 100644
index 147b6e13..00000000
--- a/packages/superdeck/lib/components/molecules/split_view.dart
+++ /dev/null
@@ -1,106 +0,0 @@
-import 'package:flutter/foundation.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:go_router/go_router.dart';
-
-import '../../helpers/hooks.dart';
-import '../../helpers/routes.dart';
-import '../../helpers/utils.dart';
-import '../atoms/sized_transition.dart';
-import '../organisms/chat_panel.dart';
-import '../organisms/presentation_side_panel.dart';
-import 'navigation_rail.dart';
-
-class SplitView extends HookWidget {
- final StatefulNavigationShell navigationShell;
-
- const SplitView({
- super.key,
- required this.navigationShell,
- });
-
- final _maxWidth = 400.0;
- final _thumbnailWidth = 300.0;
-
- @override
- Widget build(BuildContext context) {
- final sideSize = useState(0.0);
-
- useEffect(() {
- if (context.isMobileLandscape) {
- sideSize.value = 200.0;
- } else {
- sideSize.value = _maxWidth;
- }
- }, [navigationShell.currentIndex]);
-
- final animationController = useAnimationController(
- duration: Durations.medium1,
- );
-
- final animation = useAnimation(CurvedAnimation(
- parent: animationController,
- curve: Curves.ease,
- ));
-
- usePostFrameEffect(() {
- if (context.isDrawerOpen) {
- animationController.forward();
- } else {
- animationController.reverse();
- }
- }, [context.isDrawerOpen]);
-
- return LayoutBuilder(
- builder: (context, constraints) {
- final sidebar = switch (navigationShell.currentIndex) {
- 0 => SizedBox(
- width: _thumbnailWidth,
- child: const PresentationSidePanel(),
- ),
- 1 => SizedBox(
- width: _thumbnailWidth,
- child: const ChatScreen(),
- ),
- _ => const SizedBox.shrink(),
- };
-
- return Row(
- children: [
- SizedTransition(
- sizeFactor: animation,
- child: Row(
- children: [
- CustomNavigationRail(
- selectedIndex: navigationShell.currentIndex,
- onDestinationSelected: (value) {
- navigationShell.goBranch(value);
- },
- leading: 20,
- destinations: [
- CustomNavigationRailDestination(
- icon: Icons.view_carousel,
- label: 'Home',
- ),
- CustomNavigationRailDestination(
- icon: Icons.chat,
- label: 'Chat',
- ),
- if (!kIsWeb)
- CustomNavigationRailDestination(
- icon: Icons.picture_as_pdf,
- label: 'Export',
- ),
- ],
- ),
- sidebar
- ],
- ),
- ),
- Expanded(child: navigationShell)
- ],
- );
- },
- );
- }
-}
diff --git a/packages/superdeck/lib/components/organisms/app_shell.dart b/packages/superdeck/lib/components/organisms/app_shell.dart
deleted file mode 100644
index ff797bbb..00000000
--- a/packages/superdeck/lib/components/organisms/app_shell.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:go_router/go_router.dart';
-
-import '../../helpers/routes.dart';
-import '../../helpers/utils.dart';
-import '../../superdeck.dart';
-import '../molecules/split_view.dart';
-
-final kScaffoldKey = GlobalKey();
-
-/// Builds the "shell" for the app by building a Scaffold with a
-/// BottomNavigationBar, where [child] is placed in the body of the Scaffold.
-class AppShell extends HookWidget {
- const AppShell({
- required this.navigationShell,
- super.key = const ValueKey('app_shell'),
- });
-
- /// The navigation shell and container for the branch Navigators.
- final StatefulNavigationShell navigationShell;
-
- @override
- Widget build(BuildContext context) {
- final isSmall = context.isSmall;
-
- final slides = useSlides();
-
- final invalidSlides = slides.whereType().toList();
- final handleNext = useCallback(() {
- if (context.currentSlidePage < slides.length) {
- context.nextSlide();
- }
- }, [slides]);
-
- final handlePrevious = useCallback(() {
- if (context.currentSlidePage > 1) {
- context.previousSlide();
- }
- }, [slides]);
-
- final bindings = {
- const SingleActivator(
- LogicalKeyboardKey.arrowRight,
- meta: true,
- ): handleNext,
- const SingleActivator(
- LogicalKeyboardKey.arrowDown,
- meta: true,
- ): handleNext,
- const SingleActivator(
- LogicalKeyboardKey.space,
- meta: true,
- ): handleNext,
- const SingleActivator(
- LogicalKeyboardKey.arrowLeft,
- meta: true,
- ): handlePrevious,
- const SingleActivator(
- LogicalKeyboardKey.arrowUp,
- meta: true,
- ): handlePrevious,
- };
-
- return CallbackShortcuts(
- bindings: bindings,
- child: Scaffold(
- backgroundColor: const Color.fromARGB(255, 9, 9, 9),
- bottomNavigationBar: null,
- extendBodyBehindAppBar: true,
- extendBody: true,
- key: kScaffoldKey,
- floatingActionButtonLocation: isSmall
- ? FloatingActionButtonLocation.miniEndFloat
- : FloatingActionButtonLocation.miniStartFloat,
- floatingActionButton: FloatingActionButton.small(
- onPressed: context.toggleDrawer,
- child: Badge(
- label: Text(invalidSlides.length.toString()),
- isLabelVisible: invalidSlides.isNotEmpty,
- child: const Icon(Icons.menu),
- ),
- ),
- body: SplitView(
- navigationShell: navigationShell,
- ),
- ),
- );
- }
-}
diff --git a/packages/superdeck/lib/components/organisms/chat_panel.dart b/packages/superdeck/lib/components/organisms/chat_panel.dart
deleted file mode 100644
index 258fef96..00000000
--- a/packages/superdeck/lib/components/organisms/chat_panel.dart
+++ /dev/null
@@ -1,356 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:flutter_markdown/flutter_markdown.dart';
-import 'package:google_generative_ai/google_generative_ai.dart';
-
-import '../../chat/components/typing_indicator.dart';
-import '../../chat/prompt.dart';
-import '../../helpers/constants.dart';
-import '../../helpers/extensions.dart';
-import '../../services/reference_service.dart';
-import '../atoms/markdown_viewer.dart';
-
-const _apiKey = '';
-
-final _geminiFlash = 'gemini-1.5-flash-latest';
-final _geminiPro = 'gemini-1.5-pro';
-
-class ChatScreen extends StatelessWidget {
- const ChatScreen({super.key});
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text(
- 'Gemini',
- style: context.textTheme.bodySmall,
- ),
- ),
- body: const ChatWidget(apiKey: _apiKey),
- );
- }
-}
-
-class ChatWidget extends StatefulHookWidget {
- const ChatWidget({
- required this.apiKey,
- super.key,
- });
-
- final String apiKey;
-
- @override
- State createState() => _ChatWidgetState();
-}
-
-typedef GeneratedContent = ({Image? image, String? text, bool fromUser});
-
-class _ChatWidgetState extends State {
- late final GenerativeModel _model;
- late final ChatSession _chat;
-
- final _generatedContent = [];
-
- @override
- void initState() {
- super.initState();
- _model = GenerativeModel(
- model: _geminiPro,
- apiKey: widget.apiKey,
- systemInstruction: Content.system(
- presentationAssistantPrompt,
- ));
- if (kCanRunProcess) {
- ReferenceService.instance.loadMarkdown().then((value) {
- final content = '\n$value\n';
- _chat = _model.startChat(history: [
- // add around value
- Content.text(content),
- ]);
- });
- } else {
- _chat = _model.startChat();
- }
- }
-
- @override
- Widget build(BuildContext context) {
- final _textController = useTextEditingController();
- final _scrollController = useScrollController();
- final _loading = useState(false);
- final _applyChanges = useState(false);
-
- void _scrollDown() {
- WidgetsBinding.instance.addPostFrameCallback(
- (_) => _scrollController.animateTo(
- _scrollController.position.maxScrollExtent,
- duration: const Duration(
- milliseconds: 200,
- ),
- curve: Curves.easeOutCirc,
- ),
- );
- }
-
- final _sendChatMessage = useCallback((String message) async {
- _loading.value = true;
-
- _textController.clear();
-
- try {
- if (!_applyChanges.value) {
- _generatedContent.add((image: null, text: message, fromUser: true));
- }
- final response = await _chat.sendMessage(
- Content.text(message),
- );
- final text = response.text;
- if (!_applyChanges.value) {
- _generatedContent.add((image: null, text: text, fromUser: false));
- } else {
- // Replace and with empty string
- final provideMarkdownEdits = text!
- .replaceAll('', '')
- .replaceAll('', '');
- await ReferenceService.instance.saveMarkdown(provideMarkdownEdits);
- _generatedContent.add((
- image: null,
- text: 'I have applied the changes.',
- fromUser: false
- ));
- }
-
- if (text == null) {
- _showError('No response from API.');
- return;
- } else {
- _loading.value = false;
- _scrollDown();
- }
- } catch (e) {
- _showError(e.toString());
- } finally {
- _loading.value = false;
- }
- }, []);
-
- final _textFieldFocus = useFocusNode(
- onKeyEvent: (node, event) {
- if (event is KeyUpEvent) {
- return KeyEventResult.ignored;
- }
-
- final isEnterKey = event.logicalKey == LogicalKeyboardKey.enter ||
- event.logicalKey == LogicalKeyboardKey.numpadEnter;
-
- if (HardwareKeyboard.instance.isShiftPressed && isEnterKey) {
- _textController.value = TextEditingValue(
- text: _textController.text + '\n',
- selection: TextSelection.collapsed(
- offset: _textController.text.length + 1),
- );
- return KeyEventResult.handled;
- }
-
- if (isEnterKey) {
- if (event is KeyDownEvent) {
- _sendChatMessage(_textController.text);
- return KeyEventResult.handled;
- }
- }
- return KeyEventResult.ignored;
- },
- );
- useEffect(() {
- if (!_loading.value) {
- _textFieldFocus.requestFocus();
- }
- }, [_loading.value]);
-
- Widget _buildSendButton() {
- if (!_loading.value) {
- return IconButton(
- onPressed: () async {
- _sendChatMessage(_textController.text);
- },
- icon: Icon(
- Icons.send,
- color: Theme.of(context).colorScheme.primary,
- ),
- );
- }
-
- return Padding(
- padding: EdgeInsets.only(right: 16.0),
- child: WaitingIndicator(isTyping: true),
- );
- }
-
- Widget _buildApplyChangesButton() {
- return Padding(
- padding: const EdgeInsets.all(8.0),
- child: IconButton(
- onPressed: () async {
- _applyChanges.value = true;
- _sendChatMessage(provideMarkdownEdits);
- },
- icon: Icon(
- Icons.bolt,
- color: Theme.of(context).colorScheme.primary,
- ),
- ),
- );
- }
-
- final textFieldDecoration = InputDecoration(
- filled: true,
- fillColor: Colors.black45,
- hoverColor: Colors.black45,
- hintText: _loading.value ? '' : 'Type a message',
- enabled: !_loading.value,
- hintStyle: TextStyle(color: Colors.white),
- suffixIcon: _buildSendButton(),
- prefixIcon: _buildApplyChangesButton(),
- suffixIconConstraints: const BoxConstraints(
- minWidth: 20,
- minHeight: 20,
- ),
- prefixIconConstraints: const BoxConstraints(
- minWidth: 20,
- minHeight: 20,
- ),
- border: OutlineInputBorder(
- borderRadius: BorderRadius.circular(16),
- borderSide: BorderSide.none,
- ),
- contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
- );
-
- return Padding(
- padding: const EdgeInsets.all(8.0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Expanded(
- child: _apiKey.isNotEmpty
- ? ListView.builder(
- controller: _scrollController,
- itemBuilder: (context, idx) {
- final content = _generatedContent[idx];
- return MessageWidget(
- text: content.text,
- image: content.image,
- isFromUser: content.fromUser,
- );
- },
- itemCount: _generatedContent.length,
- )
- : ListView(
- children: const [
- Text(
- 'No API key found. Please provide an API Key using '
- "'--dart-define' to set the 'API_KEY' declaration.",
- ),
- ],
- ),
- ),
- Row(
- children: [
- Expanded(
- child: ConstrainedBox(
- constraints: const BoxConstraints(maxHeight: 80),
- child: Padding(
- padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
- child: TextField(
- enabled: !_loading.value,
- keyboardType: TextInputType.multiline,
- autofocus: true,
- expands: true,
- style: context.textTheme.bodyMedium,
- focusNode: _textFieldFocus,
- decoration: textFieldDecoration,
- maxLines: null,
- controller: _textController,
- ),
- ),
- ),
- ),
- ],
- ),
- ],
- ),
- );
- }
-
- void _showError(String message) {
- showDialog(
- context: context,
- builder: (context) {
- return AlertDialog(
- title: const Text('Something went wrong'),
- content: SingleChildScrollView(
- child: SelectableText(message),
- ),
- actions: [
- TextButton(
- onPressed: () {
- Navigator.of(context).pop();
- },
- child: const Text('OK'),
- )
- ],
- );
- },
- );
- }
-}
-
-class MessageWidget extends StatelessWidget {
- const MessageWidget({
- super.key,
- this.image,
- this.text,
- required this.isFromUser,
- });
-
- final Image? image;
- final String? text;
- final bool isFromUser;
-
- @override
- Widget build(BuildContext context) {
- return Row(
- mainAxisAlignment:
- isFromUser ? MainAxisAlignment.end : MainAxisAlignment.start,
- children: [
- Flexible(
- child: Container(
- constraints: const BoxConstraints(maxWidth: 520),
- decoration: BoxDecoration(
- color: isFromUser
- ? Theme.of(context).colorScheme.primaryContainer
- : Theme.of(context).colorScheme.surfaceContainerHighest,
- borderRadius: BorderRadius.circular(18),
- ),
- padding: const EdgeInsets.symmetric(
- vertical: 15,
- horizontal: 20,
- ),
- margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
- child: Column(children: [
- if (text case final text?)
- MarkdownBody(
- data: text,
- builders: {
- 'code': SampleCodeElementBuilder(null),
- },
- ),
- if (image case final image?) image,
- ]))),
- ],
- );
- }
-}
diff --git a/packages/superdeck/lib/components/organisms/drawer.dart b/packages/superdeck/lib/components/organisms/drawer.dart
deleted file mode 100644
index b258e5ff..00000000
--- a/packages/superdeck/lib/components/organisms/drawer.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'package:flutter/material.dart';
-
-enum SideMenu {
- preview(icon: Icons.play_arrow, label: 'Preview'),
-
- clearCache(icon: Icons.cached, label: 'Clear Cache');
-
- const SideMenu({
- required this.icon,
- required this.label,
- });
-
- final IconData icon;
- final String label;
-
- static List devMenu = [
- ...values,
- ];
-
- static List prodMenu = [
- preview,
- ];
-}
diff --git a/packages/superdeck/lib/components/organisms/presentation_side_panel.dart b/packages/superdeck/lib/components/organisms/presentation_side_panel.dart
deleted file mode 100644
index 2e1f81d9..00000000
--- a/packages/superdeck/lib/components/organisms/presentation_side_panel.dart
+++ /dev/null
@@ -1,85 +0,0 @@
-import 'package:collection/collection.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
-
-import '../../helpers/hooks.dart';
-import '../../helpers/routes.dart';
-import '../../helpers/utils.dart';
-import '../../providers/controller.dart';
-import '../atoms/slide_thumbnail.dart';
-
-class PresentationSidePanel extends HookWidget {
- const PresentationSidePanel({
- super.key,
- });
-
- final _duration = const Duration(milliseconds: 300);
- final _curve = Curves.easeInOutCubic;
-
- @override
- Widget build(BuildContext context) {
- final currentSlideIndex = context.currentSlidePage - 1;
-
- final slides = useSlides();
- final controller = useScrollVisibleController();
- final visibleItems = controller.visibleItems;
-
- usePostFrameEffect(() {
- if (visibleItems.isEmpty) return;
-
- final visibleItem =
- visibleItems.firstWhereOrNull((e) => e.index == currentSlideIndex);
-
- double alignment;
-
- if (visibleItem == null) {
- final isBeginning = visibleItems.first.index > currentSlideIndex;
-
- alignment = isBeginning ? 0 : 0.7;
- } else {
- if (visibleItem.itemTrailingEdge > 1) {
- final totalSpace =
- visibleItem.itemTrailingEdge - visibleItem.itemLeadingEdge;
- alignment = 1 - totalSpace;
- } else if (visibleItem.itemLeadingEdge < 0) {
- alignment = 0;
- } else {
- alignment = visibleItem.itemLeadingEdge;
- }
- }
- controller.itemScrollController.scrollTo(
- index: currentSlideIndex,
- alignment: alignment,
- duration: _duration,
- curve: _curve,
- );
-
- return;
- }, [currentSlideIndex, slides]);
-
- return Container(
- color: Colors.black,
- child: ScrollablePositionedList.builder(
- scrollDirection: context.isSmall ? Axis.horizontal : Axis.vertical,
- itemCount: slides.length,
- itemPositionsListener: controller.itemPositionsListener,
- itemScrollController: controller.itemScrollController,
- padding: const EdgeInsets.all(20),
- itemBuilder: (context, index) {
- return Padding(
- padding: const EdgeInsets.symmetric(
- vertical: 8,
- horizontal: 10,
- ),
- child: SlideThumbnail(
- page: index + 1,
- selected: currentSlideIndex == index,
- onTap: () => context.goToSlide(index + 1),
- slide: slides[index],
- ),
- );
- }),
- );
- }
-}
diff --git a/packages/superdeck/lib/components/remix/button.dart b/packages/superdeck/lib/components/remix/button.dart
deleted file mode 100644
index 89c271ce..00000000
--- a/packages/superdeck/lib/components/remix/button.dart
+++ /dev/null
@@ -1,100 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
-import 'package:remix/remix.dart';
-
-class SDButton extends StatelessWidget {
- const SDButton({
- required this.onPressed,
- super.key,
- required this.label,
- this.icon,
- });
-
- final VoidCallback onPressed;
- final String label;
-
- final IconData? icon;
-
- @override
- Widget build(BuildContext context) {
- return RxButton(
- onPressed: onPressed,
- type: ButtonVariant.surface,
- iconLeft: icon,
- label: label,
- );
- }
-}
-
-class SDButtonSolid extends StatelessWidget {
- const SDButtonSolid({
- required this.onPressed,
- super.key,
- required this.label,
- this.icon,
- });
-
- final VoidCallback onPressed;
- final String label;
-
- final IconData? icon;
-
- @override
- Widget build(BuildContext context) {
- return RxButton(
- onPressed: onPressed,
- type: ButtonVariant.solid,
- iconLeft: icon,
- label: label,
- );
- }
-}
-
-class SDOutlinedButton extends StatelessWidget {
- const SDOutlinedButton({
- required this.onPressed,
- super.key,
- required this.label,
- this.icon,
- });
-
- final VoidCallback onPressed;
- final String label;
-
- final IconData? icon;
-
- @override
- Widget build(BuildContext context) {
- return RxButton(
- onPressed: onPressed,
- type: ButtonVariant.outline,
- iconLeft: icon,
- label: label,
- );
- }
-}
-
-class SDIconButton extends StatelessWidget {
- const SDIconButton({
- required this.onPressed,
- super.key,
- required this.icon,
- this.selected = false,
- });
-
- final VoidCallback onPressed;
- final bool selected;
-
- final IconData icon;
-
- @override
- Widget build(BuildContext context) {
- return RxButton(
- onPressed: onPressed,
- type: selected ? ButtonVariant.surface : ButtonVariant.ghost,
- iconLeft: icon,
- size: ButtonSize.large,
- label: '',
- );
- }
-}
diff --git a/packages/superdeck/lib/components/remix/button_style.dart b/packages/superdeck/lib/components/remix/button_style.dart
deleted file mode 100644
index e69de29b..00000000
diff --git a/packages/superdeck/lib/components/superdeck_app.dart b/packages/superdeck/lib/components/superdeck_app.dart
deleted file mode 100644
index 53c8ec23..00000000
--- a/packages/superdeck/lib/components/superdeck_app.dart
+++ /dev/null
@@ -1,111 +0,0 @@
-import 'dart:async';
-
-import 'package:flutter/foundation.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:remix/remix.dart';
-import 'package:window_manager/window_manager.dart';
-
-import '../../helpers/syntax_highlighter.dart';
-import '../../superdeck.dart';
-import '../helpers/constants.dart';
-import '../helpers/routes.dart';
-import '../helpers/theme.dart';
-import '../providers/examples_provider.dart';
-import '../providers/snapshot_provider.dart';
-import '../providers/style_provider.dart';
-import 'atoms/loading_indicator.dart';
-
-final _uniqueKey = UniqueKey();
-var _initialized = false;
-
-class SuperDeckApp extends HookWidget {
- const SuperDeckApp({
- super.key,
- this.baseStyle = const Style.empty(),
- this.styles = const {},
- this.examples = const {},
- });
-
- final Style baseStyle;
- final Map examples;
- final Map styles;
-
- static Future initialize() async {
- // Return if its initialized
- if (_initialized) return;
-
- _initialized = true;
-
- WidgetsFlutterBinding.ensureInitialized();
-
- await Future.wait([
- SuperDeckController.initialize(),
- SyntaxHighlight.initialize(),
- _initializeWindowManager(),
- ]);
- }
-
- @override
- Widget build(BuildContext context) {
- return FutureBuilder(
- future: SuperDeckApp.initialize(),
- builder: (context, snapshot) {
- return StyleProvider(
- baseStyle: baseStyle,
- styles: styles,
- child: ExamplesProvider(
- examples: examples,
- child: ListenableBuilder(
- listenable: $superdeck,
- builder: (context, snapshot) {
- return RemixTokens(
- data: RemixTokens.dark,
- child: MaterialApp.router(
- debugShowCheckedModeBanner: true,
- title: 'Superdeck',
- routerConfig: goRouterConfig,
- theme: theme,
- builder: (context, child) {
- return SnapshotProvider(
- isCapturing: true,
- child: LoadingOverlay(
- isLoading: $superdeck.loading,
- key: _uniqueKey,
- child: $superdeck.completed
- ? child!
- : const SizedBox(),
- ),
- );
- },
- ),
- );
- }),
- ),
- );
- },
- );
- }
-}
-
-Future _initializeWindowManager() async {
- if (kIsWeb) return;
-
- // Must add this line.
- await windowManager.ensureInitialized();
-
- const windowOptions = WindowOptions(
- size: kResolution,
- backgroundColor: Colors.black,
- skipTaskbar: false,
- minimumSize: kResolution,
- titleBarStyle: TitleBarStyle.hidden,
- );
-
- windowManager.waitUntilReadyToShow(windowOptions, () async {
- await windowManager.show();
- await windowManager.focus();
- });
-
- await windowManager.setAspectRatio(kAspectRatio);
-}
diff --git a/packages/superdeck/lib/helpers/cache_memory_image.dart b/packages/superdeck/lib/helpers/cache_memory_image.dart
deleted file mode 100644
index 8e9f7e07..00000000
--- a/packages/superdeck/lib/helpers/cache_memory_image.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-import 'dart:convert';
-
-import 'package:flutter/foundation.dart';
-import 'package:flutter/widgets.dart';
-
-class CachedMemoryImage extends StatelessWidget {
- final String base64Image;
- final double? width;
- final double? height;
- final BoxFit fit;
-
- const CachedMemoryImage({
- super.key,
- required this.base64Image,
- this.width,
- this.height,
- this.fit = BoxFit.cover,
- });
-
- @override
- Widget build(BuildContext context) {
- final Uint8List bytes = base64Decode(base64Image);
- final MemoryImage memoryImage = MemoryImage(bytes);
-
- return Image(
- image: memoryImage,
- width: width,
- height: height,
- fit: fit,
- key: ValueKey(base64Image),
- gaplessPlayback: true,
- );
- }
-}
diff --git a/packages/superdeck/lib/helpers/dialog_page.dart b/packages/superdeck/lib/helpers/dialog_page.dart
deleted file mode 100644
index 4db74ae2..00000000
--- a/packages/superdeck/lib/helpers/dialog_page.dart
+++ /dev/null
@@ -1,57 +0,0 @@
-import 'package:flutter/material.dart';
-
-import '../superdeck.dart';
-
-/// A dialog page with Material entrance and exit animations, modal barrier color,
-/// and modal barrier behavior (dialog is dismissible with a tap on the barrier).
-class DialogPage extends Page {
- final Offset? anchorPoint;
- final Color? barrierColor;
- final bool barrierDismissible;
- final String? barrierLabel;
- final bool useSafeArea;
- final CapturedThemes? themes;
- final WidgetBuilder builder;
-
- const DialogPage({
- required this.builder,
- this.anchorPoint,
- this.barrierColor = Colors.black54,
- this.barrierDismissible = true,
- this.barrierLabel,
- this.useSafeArea = true,
- this.themes,
- super.key,
- super.name,
- super.arguments,
- super.restorationId,
- });
-
- @override
- Route createRoute(BuildContext context) {
- return DialogRoute(
- context: kScaffoldKey.currentContext!,
- settings: this,
- builder: builder,
- anchorPoint: anchorPoint,
- barrierColor: barrierColor,
- barrierDismissible: barrierDismissible,
- barrierLabel: barrierLabel,
- useSafeArea: useSafeArea,
- themes: themes,
- );
- }
-}
-
-class ModalPage extends Page {
- const ModalPage({required this.child});
-
- final Widget child;
-
- @override
- Route createRoute(BuildContext context) => ModalBottomSheetRoute(
- settings: this,
- builder: (context) => child,
- isScrollControlled: false,
- );
-}
diff --git a/packages/superdeck/lib/helpers/extensions.dart b/packages/superdeck/lib/helpers/extensions.dart
deleted file mode 100644
index 1efeeb9a..00000000
--- a/packages/superdeck/lib/helpers/extensions.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-import 'package:flutter/material.dart';
-
-extension AsyncSnapshotX on AsyncSnapshot {
- bool get isLoading => connectionState == ConnectionState.waiting;
-
- bool get isRefreshing => connectionState == ConnectionState.active;
- Widget when({
- required Widget Function(T data) data,
- required Widget Function(Object? error, StackTrace? stackTrace) error,
- required Widget Function() loading,
- }) {
- if (hasError) {
- return error(error, stackTrace);
- }
-
- if (isLoading) {
- return loading();
- }
-
- return data(this.data as T);
- }
-}
-
-extension BuildContextX on BuildContext {
- ThemeData get theme => Theme.of(this);
- TextTheme get textTheme => theme.textTheme;
- ColorScheme get colorScheme => theme.colorScheme;
-}
-
-extension StringX on String {
- String capitalize() {
- return "${this[0].toUpperCase()}${this.substring(1)}";
- }
-
- String snakeCase() {
- return this
- .replaceAll(RegExp(r'\s+'), '_')
- .replaceAllMapped(
- RegExp(
- r'[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+'),
- (match) => "${match.group(0)!.toLowerCase()}_")
- .replaceAll(RegExp(r'(_)\1+'), '_')
- .replaceAll(RegExp(r'^_|_$'), '');
- }
-}
diff --git a/packages/superdeck/lib/helpers/hooks.dart b/packages/superdeck/lib/helpers/hooks.dart
deleted file mode 100644
index a5a3b83b..00000000
--- a/packages/superdeck/lib/helpers/hooks.dart
+++ /dev/null
@@ -1,139 +0,0 @@
-import 'package:flutter/widgets.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
-
-void useEffectOnce(void Function()? Function() effect) {
- useEffect(effect, []);
-}
-
-void usePostFrameEffect(void Function() effect,
- [List