update federated flutter_filament

This commit is contained in:
Nick Fisher
2024-05-15 22:28:58 +08:00
parent 293d3c9fd6
commit 7703f33b81
238 changed files with 68680 additions and 2037 deletions

View File

@@ -32,7 +32,6 @@
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
@@ -48,4 +47,4 @@ app.*.map.json
/android/.cxx/**/*
# fvm
.fvm/flutter_sdk
.fvm/flutter_sdk

View File

@@ -4,9 +4,10 @@ import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_filament/flutter_filament.dart';
import 'package:vector_math/vector_math_64.dart' as v;
import 'package:dart_filament/dart_filament/abstract_filament_viewer.dart';
class CameraMatrixOverlay extends StatefulWidget {
final FlutterFilamentPlugin controller;
final AbstractFilamentViewer controller;
final bool showProjectionMatrices;
const CameraMatrixOverlay(

View File

@@ -1,5 +1,10 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_filament/filament/widgets/camera/entity_controller_mouse_widget.dart';
import 'package:flutter_filament/filament/widgets/camera/gestures/filament_gesture_detector.dart';
import 'package:flutter_filament/filament/widgets/filament_widget.dart';
import 'package:flutter_filament/flutter_filament.dart';
import 'package:dart_filament/dart_filament/entities/entity_transform_controller.dart';
class ExampleViewport extends StatelessWidget {
final FlutterFilamentPlugin? controller;
@@ -16,14 +21,14 @@ class ExampleViewport extends StatelessWidget {
@override
Widget build(BuildContext context) {
return controller != null
return controller != null
? Padding(
padding: padding,
child: EntityTransformMouseControllerWidget(
transformController: entityTransformController,
child: FilamentGestureDetector(
showControlOverlay: true,
controller: controller!,
controller: controller!.viewer,
child: FilamentWidget(
plugin: controller!,
))))

View File

@@ -1,20 +1,15 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_filament_example/camera_matrix_overlay.dart';
import 'package:flutter_filament_example/menus/controller_menu.dart';
import 'package:flutter_filament_example/example_viewport.dart';
import 'package:flutter_filament_example/picker_result_widget.dart';
import 'package:dart_filament/dart_filament/entities/entity_transform_controller.dart';
import 'package:flutter_filament_example/menus/scene_menu.dart';
import 'package:flutter_filament/flutter_filament.dart';
const loadDefaultScene = bool.hasEnvironment('--load-default-scene');
void main() async {
print(loadDefaultScene);
runApp(const MyApp());
}
@@ -39,7 +34,9 @@ class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
bodyLarge: TextStyle(fontSize: 14),
bodyMedium: TextStyle(fontSize: 12))),
// showPerformanceOverlay: true,
home: const Scaffold(body: ExampleWidget()));
home: const Scaffold(
backgroundColor: Color(0x00000000),
body: ExampleWidget()));
}
}
@@ -55,7 +52,7 @@ class ExampleWidget extends StatefulWidget {
enum MenuType { controller, assets, camera, misc }
class ExampleWidgetState extends State<ExampleWidget> {
FlutterFilamentPlugin? _plugin;
final _plugin = FlutterFilamentPlugin();
EdgeInsets _viewportMargin = EdgeInsets.zero;
@@ -85,27 +82,6 @@ class ExampleWidgetState extends State<ExampleWidget> {
@override
void initState() {
super.initState();
if (loadDefaultScene) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
_plugin = await FlutterFilamentPlugin.create();
setState(() {});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
await _plugin!.initialized;
await _plugin!
.loadSkybox("assets/default_env/default_env_skybox.ktx");
await _plugin!.setRendering(true);
await _plugin!.loadGlb("assets/shapes/shapes.glb");
await _plugin!.setCameraManipulatorOptions(zoomSpeed: 1.0);
hasSkybox = true;
rendering = true;
});
});
}
}
@override
@@ -120,95 +96,102 @@ class ExampleWidgetState extends State<ExampleWidget> {
@override
Widget build(BuildContext context) {
return Stack(children: [
Positioned.fill(
child: ExampleViewport(
controller: _plugin,
entityTransformController: _transformController,
padding: _viewportMargin,
keyboardFocusNode: _sharedFocusNode),
),
EntityListWidget(controller: _plugin),
Positioned(
bottom: Platform.isIOS ? 30 : 0,
left: 0,
right: 10,
height: 30,
child: Container(
height: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Colors.white.withOpacity(0.25),
),
padding: const EdgeInsets.symmetric(horizontal: 10),
child:
Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
ControllerMenu(
sharedFocusNode: _sharedFocusNode,
return FutureBuilder(
future: _plugin.initialized,
builder: (_, AsyncSnapshot<bool> initialized) {
var isInitialized = initialized.data == true;
return Stack(children: [
if (isInitialized)
Positioned.fill(
child: ExampleViewport(
controller: _plugin,
onToggleViewport: () {
setState(() {
_viewportMargin = (_viewportMargin == EdgeInsets.zero)
? const EdgeInsets.all(30)
: EdgeInsets.zero;
});
},
onControllerDestroyed: () {},
onControllerCreated: (controller) {
setState(() {
_plugin = controller;
});
}),
SceneMenu(
sharedFocusNode: _sharedFocusNode,
controller: _plugin,
),
GestureDetector(
onTap: () async {
await _plugin!
.loadGlb('assets/shapes/shapes.glb', numInstances: 1);
},
child: Container(
color: Colors.transparent,
child: const Text("shapes.glb"))),
const SizedBox(width: 5),
GestureDetector(
onTap: () async {
await _plugin!.loadGlb('assets/1.glb');
},
child: Container(
color: Colors.transparent, child: const Text("1.glb"))),
const SizedBox(width: 5),
GestureDetector(
onTap: () async {
await _plugin!.loadGlb('assets/2.glb');
},
child: Container(
color: Colors.transparent, child: const Text("2.glb"))),
const SizedBox(width: 5),
GestureDetector(
onTap: () async {
await _plugin!.loadGlb('assets/3.glb');
},
child: Container(
color: Colors.transparent, child: const Text("3.glb"))),
Expanded(child: Container()),
]))),
_plugin == null
? Container()
: Padding(
padding: const EdgeInsets.only(top: 10, left: 20, right: 20),
child: ValueListenableBuilder(
valueListenable: showProjectionMatrices,
builder: (ctx, value, child) => CameraMatrixOverlay(
controller: _plugin!, showProjectionMatrices: value)),
),
_plugin == null
? Container()
: Align(
alignment: Alignment.topRight,
child: PickerResultWidget(controller: _plugin!),
)
]);
entityTransformController: _transformController,
padding: _viewportMargin,
keyboardFocusNode: _sharedFocusNode),
),
Positioned(
bottom: 30,
left: 0,
right: 10,
height: 30,
child: Container(
height: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Colors.white.withOpacity(0.25),
),
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ControllerMenu(
sharedFocusNode: _sharedFocusNode,
controller: _plugin,
onToggleViewport: () {
setState(() {
_viewportMargin =
(_viewportMargin == EdgeInsets.zero)
? const EdgeInsets.all(30)
: EdgeInsets.zero;
});
},
onControllerDestroyed: () {},
onControllerCreated: () {}),
SceneMenu(
sharedFocusNode: _sharedFocusNode,
controller: _plugin,
),
GestureDetector(
onTap: () async {
await _plugin.viewer.loadGlb(
'assets/shapes/shapes.glb',
numInstances: 1);
},
child: Container(
color: Colors.transparent,
child: const Text("shapes.glb"))),
const SizedBox(width: 5),
GestureDetector(
onTap: () async {
await _plugin.viewer.loadGlb('assets/1.glb');
},
child: Container(
color: Colors.transparent,
child: const Text("1.glb"))),
const SizedBox(width: 5),
GestureDetector(
onTap: () async {
await _plugin.viewer.loadGlb('assets/2.glb');
},
child: Container(
color: Colors.transparent,
child: const Text("2.glb"))),
const SizedBox(width: 5),
GestureDetector(
onTap: () async {
await _plugin.viewer.loadGlb('assets/3.glb');
},
child: Container(
color: Colors.transparent,
child: const Text("3.glb"))),
Expanded(child: Container()),
]))),
if (isInitialized) ...[
// EntityListWidget(controller: _plugin.viewer),
// Padding(
// padding: const EdgeInsets.only(top: 10, left: 20, right: 20),
// child: ValueListenableBuilder(
// valueListenable: showProjectionMatrices,
// builder: (ctx, value, child) => CameraMatrixOverlay(
// controller: _plugin, showProjectionMatrices: value)),
// ),
// Align(
// alignment: Alignment.topRight,
// child: PickerResultWidget(controller: _plugin.viewer),
// )
]
]);
});
}
}

View File

@@ -3,10 +3,9 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_filament/flutter_filament.dart';
import 'package:flutter_filament_example/main.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:animation_tools_dart/animation_tools_dart.dart';
import 'package:vector_math/vector_math_64.dart' as v;
import 'package:dart_filament/dart_filament.dart';
import 'package:dart_filament/dart_filament/abstract_filament_viewer.dart';
class AssetSubmenu extends StatefulWidget {
final FlutterFilamentPlugin controller;
@@ -27,8 +26,8 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
MenuItemButton(
closeOnActivate: false,
onPressed: () async {
var entity = await widget.controller.getChildEntity(
widget.controller.scene.listEntities().last, "Cylinder");
var entity = await widget.controller.viewer.getChildEntity(
widget.controller.viewer.scene.listEntities().last, "Cylinder");
await showDialog(
context: context,
builder: (BuildContext context) {
@@ -40,8 +39,8 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
child: const Text('Find Cylinder entity by name')),
MenuItemButton(
onPressed: () async {
await widget.controller.addBoneAnimation(
widget.controller.scene.listEntities().last,
await widget.controller.viewer.addBoneAnimation(
widget.controller.viewer.scene.listEntities().last,
BoneAnimationData([
"Bone"
], [
@@ -56,14 +55,14 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
const Text('Set bone transform for Cylinder (pi/2 rotation X)')),
MenuItemButton(
onPressed: () async {
await widget.controller
.resetBones(widget.controller.scene.listEntities().last);
await widget.controller.viewer
.resetBones(widget.controller.viewer.scene.listEntities().last);
},
child: const Text('Reset bones for Cylinder')),
MenuItemButton(
onPressed: () async {
await widget.controller.addBoneAnimation(
widget.controller.scene.listEntities().last,
await widget.controller.viewer.addBoneAnimation(
widget.controller.viewer.scene.listEntities().last,
BoneAnimationData(
["Bone"],
["Cylinder"],
@@ -81,8 +80,8 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
MenuItemButton(
closeOnActivate: false,
onPressed: () async {
var names = await widget.controller.getMorphTargetNames(
widget.controller.scene.listEntities().last, "Cylinder");
var names = await widget.controller.viewer.getMorphTargetNames(
widget.controller.viewer.scene.listEntities().last, "Cylinder");
print("NAMES : $names");
await showDialog(
context: context,
@@ -97,24 +96,24 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
child: const Text("Show morph target names for Cylinder")),
MenuItemButton(
onPressed: () async {
var cylinder = await widget.controller.getChildEntity(
widget.controller.scene.listEntities().last, "Cylinder");
widget.controller
var cylinder = await widget.controller.viewer.getChildEntity(
widget.controller.viewer.scene.listEntities().last, "Cylinder");
widget.controller.viewer
.setMorphTargetWeights(cylinder, List.filled(4, 1.0));
},
child: const Text("set Cylinder morph weights to 1")),
MenuItemButton(
onPressed: () async {
var cylinder = await widget.controller.getChildEntity(
widget.controller.scene.listEntities().last, "Cylinder");
widget.controller
var cylinder = await widget.controller.viewer.getChildEntity(
widget.controller.viewer.scene.listEntities().last, "Cylinder");
widget.controller.viewer
.setMorphTargetWeights(cylinder, List.filled(4, 0.0));
},
child: const Text("Set Cylinder morph weights to 0")),
MenuItemButton(
onPressed: () async {
var morphTargets = await widget.controller.getMorphTargetNames(
widget.controller.scene.listEntities().last, "Cylinder");
var morphTargets = await widget.controller.viewer.getMorphTargetNames(
widget.controller.viewer.scene.listEntities().last, "Cylinder");
var morphData = MorphAnimationData(
List.generate(
@@ -122,8 +121,8 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
(frameNum) =>
List.generate(4, (morphIndex) => frameNum / 60)),
morphTargets);
await widget.controller.setMorphAnimationData(
widget.controller.scene.listEntities().last, morphData,
await widget.controller.viewer.setMorphAnimationData(
widget.controller.viewer.scene.listEntities().last, morphData,
targetMeshNames: [
"Cylinder",
]);
@@ -131,19 +130,19 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
child: const Text("create manual morph animation for Cylinder")),
MenuItemButton(
onPressed: () async {
widget.controller.setPosition(
widget.controller.scene.listEntities().last, 1.0, 1.0, -1.0);
widget.controller.viewer.setPosition(
widget.controller.viewer.scene.listEntities().last, 1.0, 1.0, -1.0);
},
child: const Text('Set position to 1, 1, -1'),
),
MenuItemButton(
onPressed: () async {
if (ExampleWidgetState.coneHidden) {
widget.controller
.reveal(widget.controller.scene.listEntities().last, "Cone");
widget.controller.viewer
.reveal(widget.controller.viewer.scene.listEntities().last, "Cone");
} else {
widget.controller
.hide(widget.controller.scene.listEntities().last, "Cone");
widget.controller.viewer
.hide(widget.controller.viewer.scene.listEntities().last, "Cone");
}
ExampleWidgetState.coneHidden = !ExampleWidgetState.coneHidden;
@@ -153,8 +152,8 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
MenuItemButton(
onPressed: () async {
final color = Colors.purple;
widget.controller.setMaterialColor(
widget.controller.scene.listEntities().last,
widget.controller.viewer.setMaterialColor(
widget.controller.viewer.scene.listEntities().last,
"Cone",
0,
color.red / 255.0,
@@ -194,13 +193,13 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
-1.0,
];
var indices = [0, 1, 2, 2, 3, 0];
var geom = await widget.controller.createGeometry(verts, indices,
var geom = await widget.controller.viewer.createGeometry(verts, indices,
materialPath: "asset://assets/solidcolor.filamat");
},
child: const Text("Quad")),
MenuItemButton(
onPressed: () async {
await widget.controller.createGeometry([
await widget.controller.viewer.createGeometry([
0,
0,
0,
@@ -226,55 +225,55 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
_geometrySubmenu(),
MenuItemButton(
onPressed: () async {
await widget.controller
await widget.controller.viewer
.addLight(1, 6500, 150000, 0, 1, 0, 0, -1, 0, true);
},
child: const Text("Add directional light"),
),
MenuItemButton(
onPressed: () async {
await widget.controller
await widget.controller.viewer
.addLight(2, 6500, 150000, 0, 1, 0, 0, -1, 0, true);
},
child: const Text("Add point light"),
),
MenuItemButton(
onPressed: () async {
await widget.controller
await widget.controller.viewer
.addLight(3, 6500, 15000000, 0, 1, 0, 0, -1, 0, true);
},
child: const Text("Add spot light"),
),
MenuItemButton(
onPressed: () async {
await widget.controller.clearLights();
await widget.controller.viewer.clearLights();
},
child: const Text("Clear lights"),
),
MenuItemButton(
onPressed: () {
final color = const Color(0xAA73C9FA);
widget.controller.setBackgroundColor(color.red / 255.0,
widget.controller.viewer.setBackgroundColor(color.red / 255.0,
color.green / 255.0, color.blue / 255.0, 1.0);
},
child: const Text("Set background color")),
MenuItemButton(
onPressed: () {
widget.controller.setBackgroundImage('assets/background.ktx');
widget.controller.viewer.setBackgroundImage('assets/background.ktx');
},
child: const Text("Load background image")),
MenuItemButton(
onPressed: () {
widget.controller.setBackgroundImage('assets/background.ktx',
widget.controller.viewer.setBackgroundImage('assets/background.ktx',
fillHeight: true);
},
child: const Text("Load background image (fill height)")),
MenuItemButton(
onPressed: () {
if (ExampleWidgetState.hasSkybox) {
widget.controller.removeSkybox();
widget.controller.viewer.removeSkybox();
} else {
widget.controller
widget.controller.viewer
.loadSkybox('assets/default_env/default_env_skybox.ktx');
}
ExampleWidgetState.hasSkybox = !ExampleWidgetState.hasSkybox;
@@ -284,23 +283,18 @@ class _AssetSubmenuState extends State<AssetSubmenu> {
: 'Load skybox')),
MenuItemButton(
onPressed: () {
widget.controller
widget.controller.viewer
.loadIbl('assets/default_env/default_env_ibl.ktx');
},
child: const Text('Load IBL')),
MenuItemButton(
onPressed: () {
widget.controller.removeIbl();
widget.controller.viewer.removeIbl();
},
child: const Text('Remove IBL')),
MenuItemButton(
MenuItemButton(
onPressed: () async {
await Permission.microphone.request();
},
child: const Text("Request permissions (tests inactive->resume)")),
MenuItemButton(
onPressed: () async {
await widget.controller.clearEntities();
await widget.controller.viewer.clearEntities();
},
child: const Text('Clear assets')),
],

View File

@@ -4,8 +4,7 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math_64.dart' as v;
import 'package:flutter_filament/flutter_filament.dart';
import 'package:dart_filament/dart_filament.dart';
import 'package:dart_filament/dart_filament/abstract_filament_viewer.dart';
import 'package:flutter_filament_example/main.dart';
class CameraSubmenu extends StatefulWidget {
@@ -23,10 +22,10 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
@override
void initState() {
super.initState();
widget.controller.initialized.then((_) {
widget.controller.getCameraCullingNear().then((v) {
widget.controller.viewer.initialized.then((_) {
widget.controller.viewer.getCameraCullingNear().then((v) {
_near = v;
widget.controller.getCameraCullingFar().then((v) {
widget.controller.viewer.getCameraCullingFar().then((v) {
_far = v;
setState(() {});
});
@@ -57,7 +56,7 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
menuChildren: [1.0, 7.0, 14.0, 28.0, 56.0]
.map((v) => MenuItemButton(
onPressed: () {
widget.controller.setCameraFocalLength(v);
widget.controller.viewer.setCameraFocalLength(v);
},
child: Text(
v.toStringAsFixed(2),
@@ -72,7 +71,7 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
_near = v;
print("Setting camera culling to $_near $_far!");
widget.controller.setCameraCulling(_near!, _far!);
widget.controller.viewer.setCameraCulling(_near!, _far!);
},
child: Text(
v.toStringAsFixed(2),
@@ -86,7 +85,7 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
onPressed: () {
_far = v;
print("Setting camera culling to $_near! $_far");
widget.controller.setCameraCulling(_near!, _far!);
widget.controller.viewer.setCameraCulling(_near!, _far!);
},
child: Text(
v.toStringAsFixed(2),
@@ -96,21 +95,21 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
child: const Text("Set far")),
MenuItemButton(
onPressed: () async {
widget.controller.setCameraPosition(1.0, 1.0, -1.0);
widget.controller.viewer.setCameraPosition(1.0, 1.0, -1.0);
},
child: const Text('Set position to 1, 1, -1 (leave rotation as-is)'),
),
MenuItemButton(
onPressed: () async {
widget.controller.setCameraPosition(0.0, 0.0, 0.0);
widget.controller.setCameraRotation(
widget.controller.viewer.setCameraPosition(0.0, 0.0, 0.0);
widget.controller.viewer.setCameraRotation(
v.Quaternion.axisAngle(v.Vector3(0, 0.0, 1.0), 0.0));
},
child: const Text('Move to 0,0,0, facing towards 0,0,-1'),
),
MenuItemButton(
onPressed: () {
widget.controller.setCameraRotation(
widget.controller.viewer.setCameraRotation(
v.Quaternion.axisAngle(v.Vector3(0, 1, 0), pi / 4));
},
child: const Text("Rotate camera 45 degrees around y axis"),
@@ -119,7 +118,7 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
onPressed: () {
ExampleWidgetState.frustumCulling =
!ExampleWidgetState.frustumCulling;
widget.controller
widget.controller.viewer
.setViewFrustumCulling(ExampleWidgetState.frustumCulling);
},
child: Text(
@@ -129,7 +128,7 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
closeOnActivate: false,
onPressed: () async {
var projMatrix =
await widget.controller.getCameraProjectionMatrix();
await widget.controller.viewer.getCameraProjectionMatrix();
await showDialog(
context: context,
builder: (ctx) {
@@ -148,7 +147,7 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
menuChildren: ManipulatorMode.values.map((mm) {
return MenuItemButton(
onPressed: () {
widget.controller.setCameraManipulatorOptions(
widget.controller.viewer.setCameraManipulatorOptions(
mode: mm,
orbitSpeedX: ExampleWidgetState.orbitSpeedX,
orbitSpeedY: ExampleWidgetState.orbitSpeedY,
@@ -170,7 +169,7 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
return MenuItemButton(
onPressed: () {
ExampleWidgetState.zoomSpeed = speed;
widget.controller.setCameraManipulatorOptions(
widget.controller.viewer.setCameraManipulatorOptions(
orbitSpeedX: ExampleWidgetState.orbitSpeedX,
orbitSpeedY: ExampleWidgetState.orbitSpeedY,
zoomSpeed: ExampleWidgetState.zoomSpeed);
@@ -192,7 +191,7 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
onPressed: () {
ExampleWidgetState.orbitSpeedX = speed;
ExampleWidgetState.orbitSpeedY = speed;
widget.controller.setCameraManipulatorOptions(
widget.controller.viewer.setCameraManipulatorOptions(
orbitSpeedX: ExampleWidgetState.orbitSpeedX,
orbitSpeedY: ExampleWidgetState.orbitSpeedY,
zoomSpeed: ExampleWidgetState.zoomSpeed);
@@ -213,9 +212,9 @@ class _CameraSubmenuState extends State<CameraSubmenu> {
@override
Widget build(BuildContext context) {
if (_near == null || _far == null) {
return Container();
}
// if (_near == null || _far == null) {
// return Container();
// }
return SubmenuButton(
controller: _menuController,
menuChildren: _cameraMenu(),

View File

@@ -6,14 +6,15 @@ import 'package:flutter/widgets.dart';
import 'package:flutter_filament/flutter_filament.dart';
class ControllerMenu extends StatefulWidget {
final FlutterFilamentPlugin? controller;
final FlutterFilamentPlugin controller;
final void Function() onToggleViewport;
final void Function(FlutterFilamentPlugin controller) onControllerCreated;
final void Function() onControllerCreated;
final void Function() onControllerDestroyed;
final FocusNode sharedFocusNode;
ControllerMenu(
{this.controller,
{required this.controller,
required this.onControllerCreated,
required this.onControllerDestroyed,
required this.sharedFocusNode,
@@ -24,37 +25,26 @@ class ControllerMenu extends StatefulWidget {
}
class _ControllerMenuState extends State<ControllerMenu> {
FlutterFilamentPlugin? _flutterFilamentPlugin;
void _createController({String? uberArchivePath}) async {
if (_flutterFilamentPlugin != null) {
throw Exception("Controller already exists");
}
_flutterFilamentPlugin =
await FlutterFilamentPlugin.create(uberArchivePath: uberArchivePath);
widget.onControllerCreated(_flutterFilamentPlugin!);
widget.controller.initialize(uberArchivePath: uberArchivePath);
widget.onControllerCreated();
}
@override
void initState() {
super.initState();
_flutterFilamentPlugin = widget.controller;
}
@override
void didUpdateWidget(ControllerMenu oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.controller != _flutterFilamentPlugin) {
setState(() {
_flutterFilamentPlugin = widget.controller;
});
}
}
bool _initialized = false;
@override
Widget build(BuildContext context) {
var items = <Widget>[];
if (_flutterFilamentPlugin == null) {
if (!_initialized) {
items.addAll([
MenuItemButton(
child:
@@ -83,8 +73,7 @@ class _ControllerMenuState extends State<ControllerMenu> {
MenuItemButton(
child: const Text("Destroy viewer"),
onPressed: () async {
await _flutterFilamentPlugin!.dispose();
_flutterFilamentPlugin = null;
widget.controller.dispose();
widget.onControllerDestroyed();
setState(() {});
},

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_filament/flutter_filament.dart';
import 'package:flutter_filament_example/main.dart';
import 'package:dart_filament/dart_filament.dart';
import 'package:dart_filament/dart_filament/abstract_filament_viewer.dart';
class RenderingSubmenu extends StatefulWidget {
final FlutterFilamentPlugin controller;
@@ -19,14 +19,14 @@ class _RenderingSubmenuState extends State<RenderingSubmenu> {
menuChildren: [
MenuItemButton(
onPressed: () {
widget.controller.render();
widget.controller.viewer.render();
},
child: const Text("Render single frame"),
),
MenuItemButton(
onPressed: () {
ExampleWidgetState.rendering = !ExampleWidgetState.rendering;
widget.controller.setRendering(ExampleWidgetState.rendering);
widget.controller.viewer.setRendering(ExampleWidgetState.rendering);
},
child: Text(
"Set continuous rendering to ${!ExampleWidgetState.rendering}"),
@@ -35,14 +35,14 @@ class _RenderingSubmenuState extends State<RenderingSubmenu> {
onPressed: () {
ExampleWidgetState.framerate =
ExampleWidgetState.framerate == 60 ? 30 : 60;
widget.controller.setFrameRate(ExampleWidgetState.framerate);
widget.controller.viewer.setFrameRate(ExampleWidgetState.framerate);
},
child: Text(
"Toggle framerate (currently ${ExampleWidgetState.framerate}) "),
),
MenuItemButton(
onPressed: () {
widget.controller.setToneMapping(ToneMapper.LINEAR);
widget.controller.viewer.setToneMapping(ToneMapper.LINEAR);
},
child: const Text("Set tone mapping to linear"),
),
@@ -50,7 +50,7 @@ class _RenderingSubmenuState extends State<RenderingSubmenu> {
onPressed: () {
ExampleWidgetState.postProcessing =
!ExampleWidgetState.postProcessing;
widget.controller
widget.controller.viewer
.setPostProcessing(ExampleWidgetState.postProcessing);
},
child: Text(
@@ -60,7 +60,7 @@ class _RenderingSubmenuState extends State<RenderingSubmenu> {
onPressed: () {
ExampleWidgetState.antiAliasingMsaa =
!ExampleWidgetState.antiAliasingMsaa;
widget.controller.setAntiAliasing(
widget.controller.viewer.setAntiAliasing(
ExampleWidgetState.antiAliasingMsaa,
ExampleWidgetState.antiAliasingFxaa,
ExampleWidgetState.antiAliasingTaa);
@@ -72,7 +72,7 @@ class _RenderingSubmenuState extends State<RenderingSubmenu> {
onPressed: () {
ExampleWidgetState.antiAliasingFxaa =
!ExampleWidgetState.antiAliasingFxaa;
widget.controller.setAntiAliasing(
widget.controller.viewer.setAntiAliasing(
ExampleWidgetState.antiAliasingMsaa,
ExampleWidgetState.antiAliasingFxaa,
ExampleWidgetState.antiAliasingTaa);
@@ -83,14 +83,14 @@ class _RenderingSubmenuState extends State<RenderingSubmenu> {
MenuItemButton(
onPressed: () {
ExampleWidgetState.recording = !ExampleWidgetState.recording;
widget.controller.setRecording(ExampleWidgetState.recording);
widget.controller.viewer.setRecording(ExampleWidgetState.recording);
},
child: Text(
"Turn recording ${ExampleWidgetState.recording ? "OFF" : "ON"}) "),
),
MenuItemButton(
onPressed: () async {
await widget.controller
await widget.controller.viewer
.addLight(2, 6000, 100000, 0, 0, 0, 0, 1, 0, false);
},
child: Text("Add light"),

View File

@@ -1,9 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_filament/flutter_filament.dart';
import 'package:dart_filament/dart_filament.dart';
import 'package:dart_filament/dart_filament/abstract_filament_viewer.dart';
class PickerResultWidget extends StatelessWidget {
final FilamentViewer controller;
final AbstractFilamentViewer controller;
const PickerResultWidget({required this.controller, super.key});

View File

@@ -4,10 +4,11 @@ packages:
animation_tools_dart:
dependency: transitive
description:
name: animation_tools_dart
sha256: c4bc4096d43227b573345a3ea3cb26c3af47a70af31cd7d7d3a5b7c99e33d615
url: "https://pub.dev"
source: hosted
path: "."
ref: HEAD
resolved-ref: "1a5ffc8a58353d43ba1864c8676c47948ee9b5ce"
url: "git@github.com:nmfisher/animation_tools_dart.git"
source: git
version: "0.0.2"
archive:
dependency: transitive
@@ -136,14 +137,28 @@ packages:
path: ".."
relative: true
source: path
version: "0.6.0"
version: "0.7.0"
flutter_filament_ffi:
dependency: transitive
description:
path: "../../flutter_filament_ffi"
relative: true
source: path
version: "0.0.1"
flutter_filament_platform_interface:
dependency: transitive
description:
path: "../../flutter_filament_platform_interface"
relative: true
source: path
version: "2.0.5"
version: "0.0.1"
flutter_filament_web:
dependency: transitive
description:
path: "../../flutter_filament_web"
relative: true
source: path
version: "0.0.1"
flutter_lints:
dependency: "direct dev"
description:
@@ -332,54 +347,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.1"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
url: "https://pub.dev"
source: hosted
version: "11.3.1"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: "8bb852cd759488893805c3161d0b2b5db55db52f773dbb014420b304055ba2c5"
url: "https://pub.dev"
source: hosted
version: "12.0.6"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: e9ad66020b89ff1b63908f247c2c6f931c6e62699b756ef8b3c4569350cd8662
url: "https://pub.dev"
source: hosted
version: "9.4.4"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: "48d4fcf201a1dad93ee869ab0d4101d084f49136ec82a8a06ed9cfeacab9fd20"
url: "https://pub.dev"
source: hosted
version: "4.2.1"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
url: "https://pub.dev"
source: hosted
version: "0.2.1"
petitparser:
dependency: transitive
description:
@@ -521,6 +488,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "14.2.2"
web:
dependency: "direct main"
description:
name: web
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
webdriver:
dependency: transitive
description:

View File

@@ -6,7 +6,7 @@ description: Demonstrates how to use the flutter_filament plugin.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
environment:
sdk: ">=3.0.0 <4.0.0"
sdk: ">=3.3.0 <4.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
@@ -20,8 +20,8 @@ dependencies:
path_provider:
flutter_filament:
path: ../
permission_handler:
cupertino_icons: ^1.0.2
web:
dev_dependencies:
flutter_test:

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
// This file is no longer used by emscripten and has been created as a placeholder
// to allow build systems to transition away from depending on it.
//
// Future versions of emscripten will likely stop generating this file at all.

View File

@@ -15,6 +15,7 @@
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<script src="dart_filament.js"></script>
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
@@ -38,25 +39,151 @@
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
<style>
html, body {
margin:0;
padding:0;
}
#flutter_host {
position:absolute;
left:200;
right:0;
top:200;
bottom:0;
}
canvas {
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
width:100%;
height:100%;
}
</style>
</head>
<body>
<div style="height:30px;background:blue;width:100%"></div>
<div style="height:100px; width:100px" id="flutter_host"></div>
<canvas id="drawHere"></canvas>
<script>
window.addEventListener('load', function(ev) {
<script type="module">
window.resolveCallback = (cb, data) => {
const fn = window.df.wasmTable.get(cb);
if(data) {
fn(data);
} else {
fn();
}
}
window.createVoidCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = () => {
try {
res({});
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'v');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
window.createIntCallback = () => {
let res;
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (val) => {
try {
res(val);
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
window.createVoidPointerCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (voidPtr) => {
try {
res(voidPtr);
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
window.createBoolCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (val) => {
try {
res(val);
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
const df = await dart_filament();
window.df = df;
const dartModulePromise = WebAssembly.compileStreaming(fetch('main.wasm'));
const imports = {"dart_filament":df};
const dart2wasm_runtime = await import('./main.mjs');
const moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, imports);
window.example = moduleInstance;
await dart2wasm_runtime.invoke(moduleInstance);
// window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function(engineInitializer) {
console.log("init engine");
engineInitializer.initializeEngine({ hostElement: document.querySelector("#flutter_host")}).then(function(appRunner) {
appRunner.runApp();
});
}
});
});
</script>
// });
</script>
<body>
<canvas id="canvas"></canvas>
<div style="position:absolute;height:100%; width:100%" id="flutter_host"></div>
</body>
</html>

View File

@@ -0,0 +1,53 @@
// import 'package:polyvox_engine/app/app.dart';
// import 'package:polyvox_engine/app/states/states.dart';
// import 'package:polyvox_engine/services/asr_service.dart';
// import 'package:polyvox_web/error_handler.dart';
// import 'package:polyvox_web/services/web_asr_service.dart';
// import 'package:polyvox_web/services/web_asset_repository.dart';
// import 'package:polyvox_web/services/web_audio_service.dart';
// import 'package:polyvox_web/services/web_auth_service.dart';
// import 'package:polyvox_web/services/web_data_provider.dart';
// import 'package:polyvox_web/services/web_purchase_service.dart';
// import 'package:polyvox_web/services/web_scoring_service.dart';
// import 'package:polyvox_web/web_canvas.dart';
import 'package:dart_filament/dart_filament/abstract_filament_viewer.dart';
import 'package:dart_filament/dart_filament/compatibility/web/compatibility.dart';
import 'package:dart_filament/dart_filament/filament_viewer_impl.dart';
import 'package:dart_filament/dart_filament/compatibility/web/interop/dart_filament_js_export_type.dart';
import 'package:dart_filament/dart_filament/compatibility/web/interop/dart_filament_js_extension_type.dart';
import 'package:web/web.dart';
void main(List<String> arguments) async {
var viewer = await WebViewer.initialize();
DartFilamentJSExportViewer.initializeBindings(viewer);
print("Set wrapper, running!");
while (true) {
await Future.delayed(Duration(milliseconds: 16));
}
print("Finisehd!");
}
class WebViewer {
static Future<AbstractFilamentViewer> initialize() async {
var fc = FooChar();
final canvas = document.getElementById("canvas") as HTMLCanvasElement;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
var resourceLoader = flutter_filament_web_get_resource_loader_wrapper();
var viewer = FilamentViewer(resourceLoader: resourceLoader);
await viewer.initialized;
var width = window.innerWidth;
var height = window.innerHeight;
await viewer.createSwapChain(width.toDouble(), height.toDouble());
await viewer.updateViewportAndCameraProjection(
width.toDouble(), height.toDouble());
return viewer;
}
}

View File

@@ -0,0 +1,359 @@
let buildArgsList;
// `modulePromise` is a promise to the `WebAssembly.module` object to be
// instantiated.
// `importObjectPromise` is a promise to an object that contains any additional
// imports needed by the module that aren't provided by the standard runtime.
// The fields on this object will be merged into the importObject with which
// the module will be instantiated.
// This function returns a promise to the instantiated module.
export const instantiate = async (modulePromise, importObjectPromise) => {
let dartInstance;
function stringFromDartString(string) {
const totalLength = dartInstance.exports.$stringLength(string);
let result = '';
let index = 0;
while (index < totalLength) {
let chunkLength = Math.min(totalLength - index, 0xFFFF);
const array = new Array(chunkLength);
for (let i = 0; i < chunkLength; i++) {
array[i] = dartInstance.exports.$stringRead(string, index++);
}
result += String.fromCharCode(...array);
}
return result;
}
function stringToDartString(string) {
const length = string.length;
let range = 0;
for (let i = 0; i < length; i++) {
range |= string.codePointAt(i);
}
if (range < 256) {
const dartString = dartInstance.exports.$stringAllocate1(length);
for (let i = 0; i < length; i++) {
dartInstance.exports.$stringWrite1(dartString, i, string.codePointAt(i));
}
return dartString;
} else {
const dartString = dartInstance.exports.$stringAllocate2(length);
for (let i = 0; i < length; i++) {
dartInstance.exports.$stringWrite2(dartString, i, string.charCodeAt(i));
}
return dartString;
}
}
// Prints to the console
function printToConsole(value) {
if (typeof dartPrint == "function") {
dartPrint(value);
return;
}
if (typeof console == "object" && typeof console.log != "undefined") {
console.log(value);
return;
}
if (typeof print == "function") {
print(value);
return;
}
throw "Unable to print message: " + js;
}
// Converts a Dart List to a JS array. Any Dart objects will be converted, but
// this will be cheap for JSValues.
function arrayFromDartList(constructor, list) {
const length = dartInstance.exports.$listLength(list);
const array = new constructor(length);
for (let i = 0; i < length; i++) {
array[i] = dartInstance.exports.$listRead(list, i);
}
return array;
}
buildArgsList = function(list) {
const dartList = dartInstance.exports.$makeStringList();
for (let i = 0; i < list.length; i++) {
dartInstance.exports.$listAdd(dartList, stringToDartString(list[i]));
}
return dartList;
}
// A special symbol attached to functions that wrap Dart functions.
const jsWrappedDartFunctionSymbol = Symbol("JSWrappedDartFunction");
function finalizeWrapper(dartFunction, wrapped) {
wrapped.dartFunction = dartFunction;
wrapped[jsWrappedDartFunctionSymbol] = true;
return wrapped;
}
// Imports
const dart2wasm = {
_11: x0 => new Array(x0),
_12: x0 => new Promise(x0),
_17: (o,s,v) => o[s] = v,
_18: f => finalizeWrapper(f,x0 => dartInstance.exports._18(f,x0)),
_19: f => finalizeWrapper(f,x0 => dartInstance.exports._19(f,x0)),
_20: (x0,x1,x2) => x0.call(x1,x2),
_21: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._21(f,x0,x1)),
_22: (x0,x1) => x0.call(x1),
_23: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._23(f,x0,x1)),
_44: () => Symbol("jsBoxedDartObjectProperty"),
_75: (x0,x1) => x0.getElementById(x1),
_1495: (x0,x1) => x0.width = x1,
_1497: (x0,x1) => x0.height = x1,
_1874: () => globalThis.window,
_1916: x0 => x0.innerWidth,
_1917: x0 => x0.innerHeight,
_6850: () => globalThis.document,
_12719: () => globalThis.createVoidCallback(),
_12720: () => globalThis.createVoidPointerCallback(),
_12721: () => globalThis.createBoolCallback(),
_12722: () => globalThis.createBoolCallback(),
_12724: v => stringToDartString(v.toString()),
_12740: () => {
let stackString = new Error().stack.toString();
let frames = stackString.split('\n');
let drop = 2;
if (frames[0] === 'Error') {
drop += 1;
}
return frames.slice(drop).join('\n');
},
_12759: s => stringToDartString(JSON.stringify(stringFromDartString(s))),
_12760: s => printToConsole(stringFromDartString(s)),
_12761: f => finalizeWrapper(f,() => dartInstance.exports._12761(f)),
_12762: f => finalizeWrapper(f,() => dartInstance.exports._12762(f)),
_12763: f => finalizeWrapper(f,x0 => dartInstance.exports._12763(f,x0)),
_12764: f => finalizeWrapper(f,() => dartInstance.exports._12764(f)),
_12765: f => finalizeWrapper(f,x0 => dartInstance.exports._12765(f,x0)),
_12766: f => finalizeWrapper(f,() => dartInstance.exports._12766(f)),
_12767: f => finalizeWrapper(f,x0 => dartInstance.exports._12767(f,x0)),
_12768: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12768(f,x0,x1)),
_12769: f => finalizeWrapper(f,() => dartInstance.exports._12769(f)),
_12770: f => finalizeWrapper(f,(x0,x1,x2,x3) => dartInstance.exports._12770(f,x0,x1,x2,x3)),
_12771: f => finalizeWrapper(f,x0 => dartInstance.exports._12771(f,x0)),
_12772: f => finalizeWrapper(f,() => dartInstance.exports._12772(f)),
_12773: f => finalizeWrapper(f,x0 => dartInstance.exports._12773(f,x0)),
_12774: f => finalizeWrapper(f,x0 => dartInstance.exports._12774(f,x0)),
_12775: f => finalizeWrapper(f,() => dartInstance.exports._12775(f)),
_12776: f => finalizeWrapper(f,(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9) => dartInstance.exports._12776(f,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)),
_12777: f => finalizeWrapper(f,x0 => dartInstance.exports._12777(f,x0)),
_12778: f => finalizeWrapper(f,() => dartInstance.exports._12778(f)),
_12779: f => finalizeWrapper(f,x0 => dartInstance.exports._12779(f,x0)),
_12780: f => finalizeWrapper(f,x0 => dartInstance.exports._12780(f,x0)),
_12781: f => finalizeWrapper(f,x0 => dartInstance.exports._12781(f,x0)),
_12782: f => finalizeWrapper(f,x0 => dartInstance.exports._12782(f,x0)),
_12783: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12783(f,x0,x1)),
_12784: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12784(f,x0,x1)),
_12785: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12785(f,x0,x1)),
_12786: f => finalizeWrapper(f,() => dartInstance.exports._12786(f)),
_12787: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12787(f,x0,x1)),
_12788: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12788(f,x0,x1)),
_12789: f => finalizeWrapper(f,() => dartInstance.exports._12789(f)),
_12790: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12790(f,x0,x1)),
_12791: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12791(f,x0,x1)),
_12792: f => finalizeWrapper(f,x0 => dartInstance.exports._12792(f,x0)),
_12793: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12793(f,x0,x1)),
_12794: f => finalizeWrapper(f,(x0,x1,x2,x3) => dartInstance.exports._12794(f,x0,x1,x2,x3)),
_12795: f => finalizeWrapper(f,x0 => dartInstance.exports._12795(f,x0)),
_12796: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12796(f,x0,x1)),
_12797: f => finalizeWrapper(f,x0 => dartInstance.exports._12797(f,x0)),
_12798: f => finalizeWrapper(f,() => dartInstance.exports._12798(f)),
_12799: f => finalizeWrapper(f,() => dartInstance.exports._12799(f)),
_12800: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12800(f,x0,x1,x2)),
_12801: f => finalizeWrapper(f,() => dartInstance.exports._12801(f)),
_12802: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12802(f,x0,x1)),
_12803: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12803(f,x0,x1)),
_12804: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12804(f,x0,x1,x2)),
_12805: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12805(f,x0,x1)),
_12806: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12806(f,x0,x1)),
_12807: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12807(f,x0,x1)),
_12808: f => finalizeWrapper(f,() => dartInstance.exports._12808(f)),
_12809: f => finalizeWrapper(f,() => dartInstance.exports._12809(f)),
_12810: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12810(f,x0,x1,x2)),
_12811: f => finalizeWrapper(f,x0 => dartInstance.exports._12811(f,x0)),
_12812: f => finalizeWrapper(f,x0 => dartInstance.exports._12812(f,x0)),
_12813: f => finalizeWrapper(f,x0 => dartInstance.exports._12813(f,x0)),
_12814: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12814(f,x0,x1)),
_12815: f => finalizeWrapper(f,() => dartInstance.exports._12815(f)),
_12816: f => finalizeWrapper(f,() => dartInstance.exports._12816(f)),
_12817: f => finalizeWrapper(f,x0 => dartInstance.exports._12817(f,x0)),
_12818: f => finalizeWrapper(f,() => dartInstance.exports._12818(f)),
_12819: f => finalizeWrapper(f,() => dartInstance.exports._12819(f)),
_12820: f => finalizeWrapper(f,() => dartInstance.exports._12820(f)),
_12821: f => finalizeWrapper(f,() => dartInstance.exports._12821(f)),
_12822: f => finalizeWrapper(f,() => dartInstance.exports._12822(f)),
_12823: f => finalizeWrapper(f,() => dartInstance.exports._12823(f)),
_12824: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12824(f,x0,x1,x2)),
_12825: f => finalizeWrapper(f,() => dartInstance.exports._12825(f)),
_12826: f => finalizeWrapper(f,x0 => dartInstance.exports._12826(f,x0)),
_12827: f => finalizeWrapper(f,x0 => dartInstance.exports._12827(f,x0)),
_12828: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12828(f,x0,x1,x2)),
_12829: f => finalizeWrapper(f,x0 => dartInstance.exports._12829(f,x0)),
_12830: f => finalizeWrapper(f,x0 => dartInstance.exports._12830(f,x0)),
_12831: f => finalizeWrapper(f,(x0,x1,x2,x3,x4,x5,x6) => dartInstance.exports._12831(f,x0,x1,x2,x3,x4,x5,x6)),
_12832: f => finalizeWrapper(f,x0 => dartInstance.exports._12832(f,x0)),
_12833: f => finalizeWrapper(f,(x0,x1,x2,x3) => dartInstance.exports._12833(f,x0,x1,x2,x3)),
_12834: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12834(f,x0,x1)),
_12835: f => finalizeWrapper(f,(x0,x1,x2,x3,x4) => dartInstance.exports._12835(f,x0,x1,x2,x3,x4)),
_12836: f => finalizeWrapper(f,(x0,x1,x2,x3,x4) => dartInstance.exports._12836(f,x0,x1,x2,x3,x4)),
_12837: f => finalizeWrapper(f,(x0,x1,x2,x3,x4,x5) => dartInstance.exports._12837(f,x0,x1,x2,x3,x4,x5)),
_12838: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12838(f,x0,x1,x2)),
_12839: f => finalizeWrapper(f,x0 => dartInstance.exports._12839(f,x0)),
_12840: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12840(f,x0,x1,x2)),
_12841: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12841(f,x0,x1)),
_12842: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12842(f,x0,x1)),
_12843: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12843(f,x0,x1)),
_12844: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12844(f,x0,x1)),
_12845: f => finalizeWrapper(f,x0 => dartInstance.exports._12845(f,x0)),
_12846: f => finalizeWrapper(f,() => dartInstance.exports._12846(f)),
_12847: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12847(f,x0,x1)),
_12848: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12848(f,x0,x1)),
_12849: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12849(f,x0,x1)),
_12850: f => finalizeWrapper(f,x0 => dartInstance.exports._12850(f,x0)),
_12851: f => finalizeWrapper(f,x0 => dartInstance.exports._12851(f,x0)),
_12852: f => finalizeWrapper(f,x0 => dartInstance.exports._12852(f,x0)),
_12853: f => finalizeWrapper(f,x0 => dartInstance.exports._12853(f,x0)),
_12854: f => finalizeWrapper(f,() => dartInstance.exports._12854(f)),
_12868: (ms, c) =>
setTimeout(() => dartInstance.exports.$invokeCallback(c),ms),
_12872: (c) =>
queueMicrotask(() => dartInstance.exports.$invokeCallback(c)),
_12874: (a, i) => a.push(i),
_12885: a => a.length,
_12887: (a, i) => a[i],
_12888: (a, i, v) => a[i] = v,
_12890: a => a.join(''),
_12900: (s, p, i) => s.indexOf(p, i),
_12903: (o, start, length) => new Uint8Array(o.buffer, o.byteOffset + start, length),
_12904: (o, start, length) => new Int8Array(o.buffer, o.byteOffset + start, length),
_12905: (o, start, length) => new Uint8ClampedArray(o.buffer, o.byteOffset + start, length),
_12906: (o, start, length) => new Uint16Array(o.buffer, o.byteOffset + start, length),
_12907: (o, start, length) => new Int16Array(o.buffer, o.byteOffset + start, length),
_12908: (o, start, length) => new Uint32Array(o.buffer, o.byteOffset + start, length),
_12909: (o, start, length) => new Int32Array(o.buffer, o.byteOffset + start, length),
_12912: (o, start, length) => new Float32Array(o.buffer, o.byteOffset + start, length),
_12913: (o, start, length) => new Float64Array(o.buffer, o.byteOffset + start, length),
_12918: (o) => new DataView(o.buffer, o.byteOffset, o.byteLength),
_12922: Function.prototype.call.bind(Object.getOwnPropertyDescriptor(DataView.prototype, 'byteLength').get),
_12923: (b, o) => new DataView(b, o),
_12925: Function.prototype.call.bind(DataView.prototype.getUint8),
_12927: Function.prototype.call.bind(DataView.prototype.getInt8),
_12929: Function.prototype.call.bind(DataView.prototype.getUint16),
_12931: Function.prototype.call.bind(DataView.prototype.getInt16),
_12933: Function.prototype.call.bind(DataView.prototype.getUint32),
_12935: Function.prototype.call.bind(DataView.prototype.getInt32),
_12941: Function.prototype.call.bind(DataView.prototype.getFloat32),
_12942: Function.prototype.call.bind(DataView.prototype.setFloat32),
_12943: Function.prototype.call.bind(DataView.prototype.getFloat64),
_12962: (x0,x1,x2) => x0[x1] = x2,
_12964: o => o === undefined,
_12965: o => typeof o === 'boolean',
_12966: o => typeof o === 'number',
_12968: o => typeof o === 'string',
_12971: o => o instanceof Int8Array,
_12972: o => o instanceof Uint8Array,
_12973: o => o instanceof Uint8ClampedArray,
_12974: o => o instanceof Int16Array,
_12975: o => o instanceof Uint16Array,
_12976: o => o instanceof Int32Array,
_12977: o => o instanceof Uint32Array,
_12978: o => o instanceof Float32Array,
_12979: o => o instanceof Float64Array,
_12980: o => o instanceof ArrayBuffer,
_12981: o => o instanceof DataView,
_12982: o => o instanceof Array,
_12983: o => typeof o === 'function' && o[jsWrappedDartFunctionSymbol] === true,
_12987: (l, r) => l === r,
_12988: o => o,
_12989: o => o,
_12990: o => o,
_12991: b => !!b,
_12992: o => o.length,
_12995: (o, i) => o[i],
_12996: f => f.dartFunction,
_12997: l => arrayFromDartList(Int8Array, l),
_12998: l => arrayFromDartList(Uint8Array, l),
_12999: l => arrayFromDartList(Uint8ClampedArray, l),
_13000: l => arrayFromDartList(Int16Array, l),
_13001: l => arrayFromDartList(Uint16Array, l),
_13002: l => arrayFromDartList(Int32Array, l),
_13003: l => arrayFromDartList(Uint32Array, l),
_13004: l => arrayFromDartList(Float32Array, l),
_13005: l => arrayFromDartList(Float64Array, l),
_13006: (data, length) => {
const view = new DataView(new ArrayBuffer(length));
for (let i = 0; i < length; i++) {
view.setUint8(i, dartInstance.exports.$byteDataGetUint8(data, i));
}
return view;
},
_13007: l => arrayFromDartList(Array, l),
_13008: stringFromDartString,
_13009: stringToDartString,
_13010: () => ({}),
_13012: l => new Array(l),
_13013: () => globalThis,
_13014: (constructor, args) => {
const factoryFunction = constructor.bind.apply(
constructor, [null, ...args]);
return new factoryFunction();
},
_13016: (o, p) => o[p],
_13018: (o, m, a) => o[m].apply(o, a),
_13020: o => String(o),
_13021: (p, s, f) => p.then(s, f),
_13040: (o, p) => o[p],
_13041: (o, p, v) => o[p] = v
};
const baseImports = {
dart2wasm: dart2wasm,
Math: Math,
Date: Date,
Object: Object,
Array: Array,
Reflect: Reflect,
};
const jsStringPolyfill = {
"charCodeAt": (s, i) => s.charCodeAt(i),
"compare": (s1, s2) => {
if (s1 < s2) return -1;
if (s1 > s2) return 1;
return 0;
},
"concat": (s1, s2) => s1 + s2,
"equals": (s1, s2) => s1 === s2,
"fromCharCode": (i) => String.fromCharCode(i),
"length": (s) => s.length,
"substring": (s, a, b) => s.substring(a, b),
};
dartInstance = await WebAssembly.instantiate(await modulePromise, {
...baseImports,
...(await importObjectPromise),
"wasm:js-string": jsStringPolyfill,
});
return dartInstance;
}
// Call the main function for the instantiated module
// `moduleInstance` is the instantiated dart2wasm module
// `args` are any arguments that should be passed into the main function.
export const invoke = (moduleInstance, ...args) => {
const dartMain = moduleInstance.exports.$getMain();
const dartArgs = buildArgsList(args);
moduleInstance.exports.$invokeMain(dartMain, dartArgs);
}

View File

@@ -0,0 +1,3 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

View File

@@ -0,0 +1,3 @@
## 1.0.0
- Initial version.

View File

@@ -0,0 +1,2 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.

View File

@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.
include: package:lints/recommended.yaml
# Uncomment the following section to specify additional rules.
# linter:
# rules:
# - camel_case_types
# analyzer:
# exclude:
# - path/to/excluded/files/**
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints
# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options

View File

@@ -0,0 +1,53 @@
// import 'package:polyvox_engine/app/app.dart';
// import 'package:polyvox_engine/app/states/states.dart';
// import 'package:polyvox_engine/services/asr_service.dart';
// import 'package:polyvox_web/error_handler.dart';
// import 'package:polyvox_web/services/web_asr_service.dart';
// import 'package:polyvox_web/services/web_asset_repository.dart';
// import 'package:polyvox_web/services/web_audio_service.dart';
// import 'package:polyvox_web/services/web_auth_service.dart';
// import 'package:polyvox_web/services/web_data_provider.dart';
// import 'package:polyvox_web/services/web_purchase_service.dart';
// import 'package:polyvox_web/services/web_scoring_service.dart';
// import 'package:polyvox_web/web_canvas.dart';
import 'package:dart_filament/dart_filament/abstract_filament_viewer.dart';
import 'package:dart_filament/dart_filament/compatibility/web/compatibility.dart';
import 'package:dart_filament/dart_filament/filament_viewer_impl.dart';
import 'package:dart_filament/dart_filament/compatibility/web/interop/dart_filament_js_export_type.dart';
import 'package:dart_filament/dart_filament/compatibility/web/interop/dart_filament_js_extension_type.dart';
import 'package:web/web.dart';
void main(List<String> arguments) async {
var viewer = await WebViewer.initialize();
DartFilamentJSExportViewer.initializeBindings(viewer);
print("Set wrapper, running!");
while (true) {
await Future.delayed(Duration(milliseconds: 16));
}
print("Finisehd!");
}
class WebViewer {
static Future<AbstractFilamentViewer> initialize() async {
var fc = FooChar();
final canvas = document.getElementById("canvas") as HTMLCanvasElement;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
var resourceLoader = flutter_filament_web_get_resource_loader_wrapper();
var viewer = FilamentViewer(resourceLoader: resourceLoader);
await viewer.initialized;
var width = window.innerWidth;
var height = window.innerHeight;
await viewer.createSwapChain(width.toDouble(), height.toDouble());
await viewer.updateViewportAndCameraProjection(
width.toDouble(), height.toDouble());
return viewer;
}
}

View File

@@ -0,0 +1,359 @@
let buildArgsList;
// `modulePromise` is a promise to the `WebAssembly.module` object to be
// instantiated.
// `importObjectPromise` is a promise to an object that contains any additional
// imports needed by the module that aren't provided by the standard runtime.
// The fields on this object will be merged into the importObject with which
// the module will be instantiated.
// This function returns a promise to the instantiated module.
export const instantiate = async (modulePromise, importObjectPromise) => {
let dartInstance;
function stringFromDartString(string) {
const totalLength = dartInstance.exports.$stringLength(string);
let result = '';
let index = 0;
while (index < totalLength) {
let chunkLength = Math.min(totalLength - index, 0xFFFF);
const array = new Array(chunkLength);
for (let i = 0; i < chunkLength; i++) {
array[i] = dartInstance.exports.$stringRead(string, index++);
}
result += String.fromCharCode(...array);
}
return result;
}
function stringToDartString(string) {
const length = string.length;
let range = 0;
for (let i = 0; i < length; i++) {
range |= string.codePointAt(i);
}
if (range < 256) {
const dartString = dartInstance.exports.$stringAllocate1(length);
for (let i = 0; i < length; i++) {
dartInstance.exports.$stringWrite1(dartString, i, string.codePointAt(i));
}
return dartString;
} else {
const dartString = dartInstance.exports.$stringAllocate2(length);
for (let i = 0; i < length; i++) {
dartInstance.exports.$stringWrite2(dartString, i, string.charCodeAt(i));
}
return dartString;
}
}
// Prints to the console
function printToConsole(value) {
if (typeof dartPrint == "function") {
dartPrint(value);
return;
}
if (typeof console == "object" && typeof console.log != "undefined") {
console.log(value);
return;
}
if (typeof print == "function") {
print(value);
return;
}
throw "Unable to print message: " + js;
}
// Converts a Dart List to a JS array. Any Dart objects will be converted, but
// this will be cheap for JSValues.
function arrayFromDartList(constructor, list) {
const length = dartInstance.exports.$listLength(list);
const array = new constructor(length);
for (let i = 0; i < length; i++) {
array[i] = dartInstance.exports.$listRead(list, i);
}
return array;
}
buildArgsList = function(list) {
const dartList = dartInstance.exports.$makeStringList();
for (let i = 0; i < list.length; i++) {
dartInstance.exports.$listAdd(dartList, stringToDartString(list[i]));
}
return dartList;
}
// A special symbol attached to functions that wrap Dart functions.
const jsWrappedDartFunctionSymbol = Symbol("JSWrappedDartFunction");
function finalizeWrapper(dartFunction, wrapped) {
wrapped.dartFunction = dartFunction;
wrapped[jsWrappedDartFunctionSymbol] = true;
return wrapped;
}
// Imports
const dart2wasm = {
_11: x0 => new Array(x0),
_12: x0 => new Promise(x0),
_17: (o,s,v) => o[s] = v,
_18: f => finalizeWrapper(f,x0 => dartInstance.exports._18(f,x0)),
_19: f => finalizeWrapper(f,x0 => dartInstance.exports._19(f,x0)),
_20: (x0,x1,x2) => x0.call(x1,x2),
_21: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._21(f,x0,x1)),
_22: (x0,x1) => x0.call(x1),
_23: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._23(f,x0,x1)),
_44: () => Symbol("jsBoxedDartObjectProperty"),
_75: (x0,x1) => x0.getElementById(x1),
_1495: (x0,x1) => x0.width = x1,
_1497: (x0,x1) => x0.height = x1,
_1874: () => globalThis.window,
_1916: x0 => x0.innerWidth,
_1917: x0 => x0.innerHeight,
_6850: () => globalThis.document,
_12719: () => globalThis.createVoidCallback(),
_12720: () => globalThis.createVoidPointerCallback(),
_12721: () => globalThis.createBoolCallback(),
_12722: () => globalThis.createBoolCallback(),
_12724: v => stringToDartString(v.toString()),
_12740: () => {
let stackString = new Error().stack.toString();
let frames = stackString.split('\n');
let drop = 2;
if (frames[0] === 'Error') {
drop += 1;
}
return frames.slice(drop).join('\n');
},
_12759: s => stringToDartString(JSON.stringify(stringFromDartString(s))),
_12760: s => printToConsole(stringFromDartString(s)),
_12761: f => finalizeWrapper(f,() => dartInstance.exports._12761(f)),
_12762: f => finalizeWrapper(f,() => dartInstance.exports._12762(f)),
_12763: f => finalizeWrapper(f,x0 => dartInstance.exports._12763(f,x0)),
_12764: f => finalizeWrapper(f,() => dartInstance.exports._12764(f)),
_12765: f => finalizeWrapper(f,x0 => dartInstance.exports._12765(f,x0)),
_12766: f => finalizeWrapper(f,() => dartInstance.exports._12766(f)),
_12767: f => finalizeWrapper(f,x0 => dartInstance.exports._12767(f,x0)),
_12768: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12768(f,x0,x1)),
_12769: f => finalizeWrapper(f,() => dartInstance.exports._12769(f)),
_12770: f => finalizeWrapper(f,(x0,x1,x2,x3) => dartInstance.exports._12770(f,x0,x1,x2,x3)),
_12771: f => finalizeWrapper(f,x0 => dartInstance.exports._12771(f,x0)),
_12772: f => finalizeWrapper(f,() => dartInstance.exports._12772(f)),
_12773: f => finalizeWrapper(f,x0 => dartInstance.exports._12773(f,x0)),
_12774: f => finalizeWrapper(f,x0 => dartInstance.exports._12774(f,x0)),
_12775: f => finalizeWrapper(f,() => dartInstance.exports._12775(f)),
_12776: f => finalizeWrapper(f,(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9) => dartInstance.exports._12776(f,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)),
_12777: f => finalizeWrapper(f,x0 => dartInstance.exports._12777(f,x0)),
_12778: f => finalizeWrapper(f,() => dartInstance.exports._12778(f)),
_12779: f => finalizeWrapper(f,x0 => dartInstance.exports._12779(f,x0)),
_12780: f => finalizeWrapper(f,x0 => dartInstance.exports._12780(f,x0)),
_12781: f => finalizeWrapper(f,x0 => dartInstance.exports._12781(f,x0)),
_12782: f => finalizeWrapper(f,x0 => dartInstance.exports._12782(f,x0)),
_12783: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12783(f,x0,x1)),
_12784: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12784(f,x0,x1)),
_12785: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12785(f,x0,x1)),
_12786: f => finalizeWrapper(f,() => dartInstance.exports._12786(f)),
_12787: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12787(f,x0,x1)),
_12788: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12788(f,x0,x1)),
_12789: f => finalizeWrapper(f,() => dartInstance.exports._12789(f)),
_12790: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12790(f,x0,x1)),
_12791: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12791(f,x0,x1)),
_12792: f => finalizeWrapper(f,x0 => dartInstance.exports._12792(f,x0)),
_12793: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12793(f,x0,x1)),
_12794: f => finalizeWrapper(f,(x0,x1,x2,x3) => dartInstance.exports._12794(f,x0,x1,x2,x3)),
_12795: f => finalizeWrapper(f,x0 => dartInstance.exports._12795(f,x0)),
_12796: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12796(f,x0,x1)),
_12797: f => finalizeWrapper(f,x0 => dartInstance.exports._12797(f,x0)),
_12798: f => finalizeWrapper(f,() => dartInstance.exports._12798(f)),
_12799: f => finalizeWrapper(f,() => dartInstance.exports._12799(f)),
_12800: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12800(f,x0,x1,x2)),
_12801: f => finalizeWrapper(f,() => dartInstance.exports._12801(f)),
_12802: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12802(f,x0,x1)),
_12803: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12803(f,x0,x1)),
_12804: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12804(f,x0,x1,x2)),
_12805: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12805(f,x0,x1)),
_12806: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12806(f,x0,x1)),
_12807: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12807(f,x0,x1)),
_12808: f => finalizeWrapper(f,() => dartInstance.exports._12808(f)),
_12809: f => finalizeWrapper(f,() => dartInstance.exports._12809(f)),
_12810: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12810(f,x0,x1,x2)),
_12811: f => finalizeWrapper(f,x0 => dartInstance.exports._12811(f,x0)),
_12812: f => finalizeWrapper(f,x0 => dartInstance.exports._12812(f,x0)),
_12813: f => finalizeWrapper(f,x0 => dartInstance.exports._12813(f,x0)),
_12814: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12814(f,x0,x1)),
_12815: f => finalizeWrapper(f,() => dartInstance.exports._12815(f)),
_12816: f => finalizeWrapper(f,() => dartInstance.exports._12816(f)),
_12817: f => finalizeWrapper(f,x0 => dartInstance.exports._12817(f,x0)),
_12818: f => finalizeWrapper(f,() => dartInstance.exports._12818(f)),
_12819: f => finalizeWrapper(f,() => dartInstance.exports._12819(f)),
_12820: f => finalizeWrapper(f,() => dartInstance.exports._12820(f)),
_12821: f => finalizeWrapper(f,() => dartInstance.exports._12821(f)),
_12822: f => finalizeWrapper(f,() => dartInstance.exports._12822(f)),
_12823: f => finalizeWrapper(f,() => dartInstance.exports._12823(f)),
_12824: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12824(f,x0,x1,x2)),
_12825: f => finalizeWrapper(f,() => dartInstance.exports._12825(f)),
_12826: f => finalizeWrapper(f,x0 => dartInstance.exports._12826(f,x0)),
_12827: f => finalizeWrapper(f,x0 => dartInstance.exports._12827(f,x0)),
_12828: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12828(f,x0,x1,x2)),
_12829: f => finalizeWrapper(f,x0 => dartInstance.exports._12829(f,x0)),
_12830: f => finalizeWrapper(f,x0 => dartInstance.exports._12830(f,x0)),
_12831: f => finalizeWrapper(f,(x0,x1,x2,x3,x4,x5,x6) => dartInstance.exports._12831(f,x0,x1,x2,x3,x4,x5,x6)),
_12832: f => finalizeWrapper(f,x0 => dartInstance.exports._12832(f,x0)),
_12833: f => finalizeWrapper(f,(x0,x1,x2,x3) => dartInstance.exports._12833(f,x0,x1,x2,x3)),
_12834: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12834(f,x0,x1)),
_12835: f => finalizeWrapper(f,(x0,x1,x2,x3,x4) => dartInstance.exports._12835(f,x0,x1,x2,x3,x4)),
_12836: f => finalizeWrapper(f,(x0,x1,x2,x3,x4) => dartInstance.exports._12836(f,x0,x1,x2,x3,x4)),
_12837: f => finalizeWrapper(f,(x0,x1,x2,x3,x4,x5) => dartInstance.exports._12837(f,x0,x1,x2,x3,x4,x5)),
_12838: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12838(f,x0,x1,x2)),
_12839: f => finalizeWrapper(f,x0 => dartInstance.exports._12839(f,x0)),
_12840: f => finalizeWrapper(f,(x0,x1,x2) => dartInstance.exports._12840(f,x0,x1,x2)),
_12841: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12841(f,x0,x1)),
_12842: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12842(f,x0,x1)),
_12843: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12843(f,x0,x1)),
_12844: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12844(f,x0,x1)),
_12845: f => finalizeWrapper(f,x0 => dartInstance.exports._12845(f,x0)),
_12846: f => finalizeWrapper(f,() => dartInstance.exports._12846(f)),
_12847: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12847(f,x0,x1)),
_12848: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12848(f,x0,x1)),
_12849: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12849(f,x0,x1)),
_12850: f => finalizeWrapper(f,x0 => dartInstance.exports._12850(f,x0)),
_12851: f => finalizeWrapper(f,x0 => dartInstance.exports._12851(f,x0)),
_12852: f => finalizeWrapper(f,x0 => dartInstance.exports._12852(f,x0)),
_12853: f => finalizeWrapper(f,x0 => dartInstance.exports._12853(f,x0)),
_12854: f => finalizeWrapper(f,() => dartInstance.exports._12854(f)),
_12868: (ms, c) =>
setTimeout(() => dartInstance.exports.$invokeCallback(c),ms),
_12872: (c) =>
queueMicrotask(() => dartInstance.exports.$invokeCallback(c)),
_12874: (a, i) => a.push(i),
_12885: a => a.length,
_12887: (a, i) => a[i],
_12888: (a, i, v) => a[i] = v,
_12890: a => a.join(''),
_12900: (s, p, i) => s.indexOf(p, i),
_12903: (o, start, length) => new Uint8Array(o.buffer, o.byteOffset + start, length),
_12904: (o, start, length) => new Int8Array(o.buffer, o.byteOffset + start, length),
_12905: (o, start, length) => new Uint8ClampedArray(o.buffer, o.byteOffset + start, length),
_12906: (o, start, length) => new Uint16Array(o.buffer, o.byteOffset + start, length),
_12907: (o, start, length) => new Int16Array(o.buffer, o.byteOffset + start, length),
_12908: (o, start, length) => new Uint32Array(o.buffer, o.byteOffset + start, length),
_12909: (o, start, length) => new Int32Array(o.buffer, o.byteOffset + start, length),
_12912: (o, start, length) => new Float32Array(o.buffer, o.byteOffset + start, length),
_12913: (o, start, length) => new Float64Array(o.buffer, o.byteOffset + start, length),
_12918: (o) => new DataView(o.buffer, o.byteOffset, o.byteLength),
_12922: Function.prototype.call.bind(Object.getOwnPropertyDescriptor(DataView.prototype, 'byteLength').get),
_12923: (b, o) => new DataView(b, o),
_12925: Function.prototype.call.bind(DataView.prototype.getUint8),
_12927: Function.prototype.call.bind(DataView.prototype.getInt8),
_12929: Function.prototype.call.bind(DataView.prototype.getUint16),
_12931: Function.prototype.call.bind(DataView.prototype.getInt16),
_12933: Function.prototype.call.bind(DataView.prototype.getUint32),
_12935: Function.prototype.call.bind(DataView.prototype.getInt32),
_12941: Function.prototype.call.bind(DataView.prototype.getFloat32),
_12942: Function.prototype.call.bind(DataView.prototype.setFloat32),
_12943: Function.prototype.call.bind(DataView.prototype.getFloat64),
_12962: (x0,x1,x2) => x0[x1] = x2,
_12964: o => o === undefined,
_12965: o => typeof o === 'boolean',
_12966: o => typeof o === 'number',
_12968: o => typeof o === 'string',
_12971: o => o instanceof Int8Array,
_12972: o => o instanceof Uint8Array,
_12973: o => o instanceof Uint8ClampedArray,
_12974: o => o instanceof Int16Array,
_12975: o => o instanceof Uint16Array,
_12976: o => o instanceof Int32Array,
_12977: o => o instanceof Uint32Array,
_12978: o => o instanceof Float32Array,
_12979: o => o instanceof Float64Array,
_12980: o => o instanceof ArrayBuffer,
_12981: o => o instanceof DataView,
_12982: o => o instanceof Array,
_12983: o => typeof o === 'function' && o[jsWrappedDartFunctionSymbol] === true,
_12987: (l, r) => l === r,
_12988: o => o,
_12989: o => o,
_12990: o => o,
_12991: b => !!b,
_12992: o => o.length,
_12995: (o, i) => o[i],
_12996: f => f.dartFunction,
_12997: l => arrayFromDartList(Int8Array, l),
_12998: l => arrayFromDartList(Uint8Array, l),
_12999: l => arrayFromDartList(Uint8ClampedArray, l),
_13000: l => arrayFromDartList(Int16Array, l),
_13001: l => arrayFromDartList(Uint16Array, l),
_13002: l => arrayFromDartList(Int32Array, l),
_13003: l => arrayFromDartList(Uint32Array, l),
_13004: l => arrayFromDartList(Float32Array, l),
_13005: l => arrayFromDartList(Float64Array, l),
_13006: (data, length) => {
const view = new DataView(new ArrayBuffer(length));
for (let i = 0; i < length; i++) {
view.setUint8(i, dartInstance.exports.$byteDataGetUint8(data, i));
}
return view;
},
_13007: l => arrayFromDartList(Array, l),
_13008: stringFromDartString,
_13009: stringToDartString,
_13010: () => ({}),
_13012: l => new Array(l),
_13013: () => globalThis,
_13014: (constructor, args) => {
const factoryFunction = constructor.bind.apply(
constructor, [null, ...args]);
return new factoryFunction();
},
_13016: (o, p) => o[p],
_13018: (o, m, a) => o[m].apply(o, a),
_13020: o => String(o),
_13021: (p, s, f) => p.then(s, f),
_13040: (o, p) => o[p],
_13041: (o, p, v) => o[p] = v
};
const baseImports = {
dart2wasm: dart2wasm,
Math: Math,
Date: Date,
Object: Object,
Array: Array,
Reflect: Reflect,
};
const jsStringPolyfill = {
"charCodeAt": (s, i) => s.charCodeAt(i),
"compare": (s1, s2) => {
if (s1 < s2) return -1;
if (s1 > s2) return 1;
return 0;
},
"concat": (s1, s2) => s1 + s2,
"equals": (s1, s2) => s1 === s2,
"fromCharCode": (i) => String.fromCharCode(i),
"length": (s) => s.length,
"substring": (s, a, b) => s.substring(a, b),
};
dartInstance = await WebAssembly.instantiate(await modulePromise, {
...baseImports,
...(await importObjectPromise),
"wasm:js-string": jsStringPolyfill,
});
return dartInstance;
}
// Call the main function for the instantiated module
// `moduleInstance` is the instantiated dart2wasm module
// `args` are any arguments that should be passed into the main function.
export const invoke = (moduleInstance, ...args) => {
const dartMain = moduleInstance.exports.$getMain();
const dartArgs = buildArgsList(args);
moduleInstance.exports.$invokeMain(dartMain, dartArgs);
}

View File

@@ -0,0 +1,329 @@
// @JS()
// library flutter_filament_js;
// import 'dart:js_interop';
// import 'package:dart_filament/dart_filament/entities/filament_entity.dart';
// extension type DartFilamentJSShim(JSObject _) implements JSObject {
// @JS('initialized')
// external JSPromise<JSBoolean> get initialized;
// @JS('rendering')
// external bool get rendering;
// @JS('setRendering')
// external JSPromise setRendering(bool render);
// @JS('render')
// external JSPromise render();
// @JS('setFrameRate')
// external JSPromise setFrameRate(int framerate);
// @JS('dispose')
// external JSPromise dispose();
// @JS('setBackgroundImage')
// external JSPromise setBackgroundImage(String path, bool fillHeight);
// @JS('setBackgroundImagePosition')
// external JSPromise setBackgroundImagePosition(double x, double y,
// bool clamp);
// @JS('clearBackgroundImage')
// external JSPromise clearBackgroundImage();
// @JS('setBackgroundColor')
// external JSPromise setBackgroundColor(
// double r, double g, double b, double alpha);
// @JS('loadSkybox')
// external JSPromise loadSkybox(String skyboxPath);
// @JS('removeSkybox')
// external JSPromise removeSkybox();
// @JS('loadIbl')
// external JSPromise loadIbl(String lightingPath, double intensity);
// @JS('rotateIbl')
// external JSPromise rotateIbl(JSArray<JSNumber> rotationMatrix);
// @JS('removeIbl')
// external JSPromise removeIbl();
// @JS('addLight')
// external JSPromise<JSNumber> addLight(
// int type,
// double colour,
// double intensity,
// double posX,
// double posY,
// double posZ,
// double dirX,
// double dirY,
// double dirZ,
// bool castShadows,
// );
// @JS('removeLight')
// external JSPromise removeLight(FilamentEntity light);
// @JS('clearLights')
// external JSPromise clearLights();
// @JS('loadGlb')
// external JSPromise<JSNumber> loadGlb(String path, int numInstances);
// @JS('createInstance')
// external JSPromise<JSNumber> createInstance(FilamentEntity entity);
// @JS('getInstanceCount')
// external JSPromise<JSNumber> getInstanceCount(FilamentEntity entity);
// @JS('getInstances')
// external JSPromise<JSArray<JSNumber>> getInstances(FilamentEntity entity);
// @JS('loadGltf')
// external JSPromise<JSNumber> loadGltf(
// String path,
// String relativeResourcePath
// );
// @JS('panStart')
// external JSPromise panStart(double x, double y);
// @JS('panUpdate')
// external JSPromise panUpdate(double x, double y);
// @JS('panEnd')
// external JSPromise panEnd();
// @JS('rotateStart')
// external JSPromise rotateStart(double x, double y);
// @JS('rotateUpdate')
// external JSPromise rotateUpdate(double x, double y);
// @JS('rotateEnd')
// external JSPromise rotateEnd();
// @JS('setMorphTargetWeights')
// external JSPromise setMorphTargetWeights(
// FilamentEntity entity, JSArray<JSNumber> weights);
// @JS('getMorphTargetNames')
// external JSPromise<JSArray<JSString>> getMorphTargetNames(
// FilamentEntity entity, String meshName);
// @JS('getAnimationNames')
// external JSPromise<JSArray<JSString>> getAnimationNames(FilamentEntity entity);
// @JS('getAnimationDuration')
// external JSPromise<JSNumber> getAnimationDuration(
// FilamentEntity entity, int animationIndex);
// @JS('setMorphAnimationData')
// external JSPromise setMorphAnimationData(
// FilamentEntity entity,
// JSArray<JSArray<JSNumber>> animation,
// JSArray<JSString> morphTargets,
// JSArray<JSString>? targetMeshNames,
// );
// @JS('resetBones')
// external JSPromise resetBones(FilamentEntity entity);
// @JS('addBoneAnimation')
// external JSPromise addBoneAnimation(FilamentEntity entity, JSObject animation);
// @JS('removeEntity')
// external JSPromise removeEntity(FilamentEntity entity);
// @JS('clearEntities')
// external JSPromise clearEntities();
// @JS('zoomBegin')
// external JSPromise zoomBegin();
// @JS('zoomUpdate')
// external JSPromise zoomUpdate(double x, double y, double z);
// @JS('zoomEnd')
// external JSPromise zoomEnd();
// @JS('playAnimation')
// external JSPromise playAnimation(
// FilamentEntity entity,
// int index,
// bool loop,
// bool reverse,
// bool replaceActive,
// double crossfade,
// );
// @JS('playAnimationByName')
// external JSPromise playAnimationByName(
// FilamentEntity entity,
// String name,
// bool loop,
// bool reverse,
// bool replaceActive,
// double crossfade,
// );
// @JS('setAnimationFrame')
// external JSPromise setAnimationFrame(
// FilamentEntity entity, int index, int animationFrame);
// @JS('stopAnimation')
// external JSPromise stopAnimation(FilamentEntity entity, int animationIndex);
// @JS('stopAnimationByName')
// external JSPromise stopAnimationByName(FilamentEntity entity, String name);
// @JS('setCamera')
// external JSPromise setCamera(FilamentEntity entity, String? name);
// @JS('setMainCamera')
// external JSPromise setMainCamera();
// @JS('getMainCamera')
// external JSPromise<JSNumber> getMainCamera();
// @JS('setCameraFov')
// external JSPromise setCameraFov(double degrees, double width, double height);
// @JS('setToneMapping')
// external JSPromise setToneMapping(int mapper);
// @JS('setBloom')
// external JSPromise setBloom(double bloom);
// @JS('setCameraFocalLength')
// external JSPromise setCameraFocalLength(double focalLength);
// @JS('setCameraCulling')
// external JSPromise setCameraCulling(double near, double far);
// @JS('getCameraCullingNear')
// external JSPromise<JSNumber> getCameraCullingNear();
// @JS('getCameraCullingFar')
// external JSPromise<JSNumber> getCameraCullingFar();
// @JS('setCameraFocusDistance')
// external JSPromise setCameraFocusDistance(double focusDistance);
// @JS('getCameraPosition')
// external JSPromise<JSArray<JSNumber>> getCameraPosition();
// @JS('getCameraModelMatrix')
// external JSPromise<JSArray<JSNumber>> getCameraModelMatrix();
// @JS('getCameraViewMatrix')
// external JSPromise<JSArray<JSNumber>> getCameraViewMatrix();
// @JS('getCameraProjectionMatrix')
// external JSPromise<JSArray<JSNumber>> getCameraProjectionMatrix();
// @JS('getCameraCullingProjectionMatrix')
// external JSPromise<JSArray<JSNumber>> getCameraCullingProjectionMatrix();
// @JS('getCameraFrustum')
// external JSPromise<JSObject> getCameraFrustum();
// @JS('setCameraPosition')
// external JSPromise setCameraPosition(double x, double y, double z);
// @JS('getCameraRotation')
// external JSPromise<JSArray<JSNumber>> getCameraRotation();
// @JS('moveCameraToAsset')
// external JSPromise moveCameraToAsset(FilamentEntity entity);
// @JS('setViewFrustumCulling')
// external JSPromise setViewFrustumCulling(JSBoolean enabled);
// @JS('setCameraExposure')
// external JSPromise setCameraExposure(
// double aperture, double shutterSpeed, double sensitivity);
// @JS('setCameraRotation')
// external JSPromise setCameraRotation(JSArray<JSNumber> quaternion);
// @JS('setCameraModelMatrix')
// external JSPromise setCameraModelMatrix(JSArray<JSNumber> matrix);
// @JS('setMaterialColor')
// external JSPromise setMaterialColor(FilamentEntity entity, String meshName,
// int materialIndex, double r, double g, double b, double a);
// @JS('transformToUnitCube')
// external JSPromise transformToUnitCube(FilamentEntity entity);
// @JS('setPosition')
// external JSPromise setPosition(FilamentEntity entity, double x, double y, double z);
// @JS('setScale')
// external JSPromise setScale(FilamentEntity entity, double scale);
// @JS('setRotation')
// external JSPromise setRotation(
// FilamentEntity entity, double rads, double x, double y, double z);
// @JS('queuePositionUpdate')
// external JSPromise queuePositionUpdate(
// FilamentEntity entity, double x, double y, double z,
// bool relative);
// @JS('queueRotationUpdate')
// external JSPromise queueRotationUpdate(
// FilamentEntity entity, double rads, double x, double y, double z,
// bool relative);
// @JS('queueRotationUpdateQuat')
// external JSPromise queueRotationUpdateQuat(
// FilamentEntity entity, JSArray<JSNumber> quat,
// bool relative);
// @JS('setPostProcessing')
// external JSPromise setPostProcessing(JSBoolean enabled);
// @JS('setAntiAliasing')
// external JSPromise setAntiAliasing(
// JSBoolean msaa, JSBoolean fxaa, JSBoolean taa);
// @JS('setRotationQuat')
// external JSPromise setRotationQuat(
// FilamentEntity entity, JSArray<JSNumber> rotation);
// @JS('reveal')
// external JSPromise reveal(FilamentEntity entity, String? meshName);
// @JS('hide')
// external JSPromise hide(FilamentEntity entity, String? meshName);
// @JS('pick')
// external void pick(int x, int y);
// @JS('getNameForEntity')
// external String? getNameForEntity(FilamentEntity entity);
// @JS('setCameraManipulatorOptions')
// external JSPromise setCameraManipulatorOptions(
// int mode,
// double orbitSpeedX ,
// double orbitSpeedY ,
// double zoomSpeed ,
// );
// @JS('getChildEntities')
// external JSPromise<JSArray<JSNumber>> getChildEntities(
// FilamentEntity parent, bool renderableOnly);
// @JS('getChildEntity')
// external JSPromise<JSNumber> getChildEntity(
// FilamentEntity parent, String childName);
// @JS('getChildEntityNames')
// external JSPromise<JSArray<JSString>> getChildEntityNames(
// FilamentEntity entity,
// );
// @JS('setRecording')
// external JSPromise setRecording(JSBoolean recording);
// @JS('setRecordingOutputDirectory')
// external JSPromise setRecordingOutputDirectory(String outputDirectory);
// @JS('addAnimationComponent')
// external JSPromise addAnimationComponent(FilamentEntity entity);
// @JS('addCollisionComponent')
// external JSPromise addCollisionComponent(FilamentEntity entity);
// @JS('removeCollisionComponent')
// external JSPromise removeCollisionComponent(FilamentEntity entity);
// @JS('createGeometry')
// external JSPromise<JSNumber> createGeometry(
// JSArray<JSNumber> vertices, JSArray<JSNumber> indices,
// String? materialPath, int primitiveType);
// @JS('setParent')
// external JSPromise setParent(FilamentEntity child, FilamentEntity parent);
// @JS('testCollisions')
// external JSPromise testCollisions(FilamentEntity entity);
// @JS('setPriority')
// external JSPromise setPriority(FilamentEntity entityId, int priority);
// }

View File

@@ -0,0 +1,545 @@
// @JS()
// library flutter_filament_js;
// import 'dart:js_interop';
// import 'package:animation_tools_dart/src/morph_animation_data.dart';
// import 'package:dart_filament/dart_filament/abstract_filament_viewer.dart';
// import 'package:dart_filament/dart_filament/entities/filament_entity.dart';
// import 'dart:js_interop';
// @JSExport()
// class DartFilamentJSExportViewer {
// final AbstractFilamentViewer viewer;
// DartFilamentJSExportViewer(this.viewer);
// JSPromise<JSBoolean> get initialized {
// return viewer.initialized.then((v) => v.toJS).toJS;
// }
// @JSExport()
// JSBoolean get rendering => viewer.rendering.toJS;
// @JSExport()
// JSPromise setRendering(bool render) {
// return viewer.setRendering(render).toJS;
// }
// @JSExport()
// JSPromise render() => viewer.render().toJS;
// @JSExport()
// JSPromise setFrameRate(int framerate) => viewer.setFrameRate(framerate).toJS;
// @JSExport()
// JSPromise dispose() => viewer.dispose().toJS;
// @JSExport()
// JSPromise setBackgroundImage(String path, {bool fillHeight = false}) =>
// viewer.setBackgroundImage(path, fillHeight: fillHeight).toJS;
// @JSExport()
// JSPromise setBackgroundImagePosition(double x, double y,
// {bool clamp = false}) =>
// viewer.setBackgroundImagePosition(x, y, clamp: clamp).toJS;
// @JSExport()
// JSPromise clearBackgroundImage() => viewer.clearBackgroundImage().toJS;
// @JSExport()
// JSPromise setBackgroundColor(double r, double g, double b, double alpha) =>
// viewer.setBackgroundColor(r, g, b, alpha).toJS;
// @JSExport()
// JSPromise loadSkybox(String skyboxPath) => viewer.loadSkybox(skyboxPath).toJS;
// @JSExport()
// JSPromise removeSkybox() => viewer.removeSkybox().toJS;
// @JSExport()
// JSPromise loadIbl(String lightingPath, {double intensity = 30000}) =>
// viewer.loadIbl(lightingPath, intensity: intensity).toJS;
// @JSExport()
// JSPromise rotateIbl(JSArray<JSNumber> rotation) => throw UnimplementedError();
// // viewer.rotateIbl(rotation.toDartMatrix3()).toJS;
// @JSExport()
// JSPromise removeIbl() => viewer.removeIbl().toJS;
// @JSExport()
// JSPromise<JSNumber> addLight(
// int type,
// double colour,
// double intensity,
// double posX,
// double posY,
// double posZ,
// double dirX,
// double dirY,
// double dirZ,
// bool castShadows) {
// return viewer
// .addLight(type, colour, intensity, posX, posY, posZ, dirX, dirY, dirZ,
// castShadows)
// .then((entity) => entity.toJS)
// .toJS;
// }
// @JSExport()
// JSPromise removeLight(FilamentEntity light) => viewer.removeLight(light).toJS;
// @JSExport()
// JSPromise clearLights() => viewer.clearLights().toJS;
// @JSExport()
// JSPromise<JSNumber> loadGlb(String path, {int numInstances = 1}) {
// return viewer
// .loadGlb(path, numInstances: numInstances)
// .then((entity) => entity.toJS)
// .toJS;
// }
// @JSExport()
// JSPromise<JSNumber> createInstance(FilamentEntity entity) {
// return viewer.createInstance(entity).then((instance) => instance.toJS).toJS;
// }
// @JSExport()
// JSPromise<JSNumber> getInstanceCount(FilamentEntity entity) =>
// viewer.getInstanceCount(entity).then((v) => v.toJS).toJS;
// @JSExport()
// JSPromise<JSArray<JSNumber>> getInstances(FilamentEntity entity) {
// return viewer
// .getInstances(entity)
// .then((instances) =>
// instances.map((instance) => instance.toJS).toList().toJS)
// .toJS;
// }
// @JSExport()
// JSPromise<JSNumber> loadGltf(String path, String relativeResourcePath,
// {bool force = false}) {
// return viewer
// .loadGltf(path, relativeResourcePath, force: force)
// .then((entity) => entity.toJS)
// .toJS;
// }
// @JSExport()
// JSPromise panStart(double x, double y) => viewer.panStart(x, y).toJS;
// @JSExport()
// JSPromise panUpdate(double x, double y) => viewer.panUpdate(x, y).toJS;
// @JSExport()
// JSPromise panEnd() => viewer.panEnd().toJS;
// @JSExport()
// JSPromise rotateStart(double x, double y) => viewer.rotateStart(x, y).toJS;
// @JSExport()
// JSPromise rotateUpdate(double x, double y) => viewer.rotateUpdate(x, y).toJS;
// @JSExport()
// JSPromise rotateEnd() => viewer.rotateEnd().toJS;
// @JSExport()
// JSPromise setMorphTargetWeights(
// FilamentEntity entity, List<double> weights) =>
// viewer.setMorphTargetWeights(entity, weights).toJS;
// @JSExport()
// JSPromise<JSArray<JSString>> getMorphTargetNames(
// FilamentEntity entity, String meshName) =>
// viewer
// .getMorphTargetNames(entity, meshName)
// .then((v) => v.map((s) => s.toJS).toList().toJS)
// .toJS;
// @JSExport()
// JSPromise<JSArray<JSString>> getAnimationNames(FilamentEntity entity) =>
// viewer
// .getAnimationNames(entity)
// .then((v) => v.map((s) => s.toJS).toList().toJS)
// .toJS;
// @JSExport()
// JSPromise<JSNumber> getAnimationDuration(
// FilamentEntity entity, int animationIndex) =>
// viewer
// .getAnimationDuration(entity, animationIndex)
// .then((v) => v.toJS)
// .toJS;
// @JSExport()
// JSPromise setMorphAnimationData(
// FilamentEntity entity,
// JSArray<JSArray<JSNumber>> animation,
// JSArray<JSString> morphTargets,
// JSArray<JSString> targetMeshNames) =>
// viewer
// .setMorphAnimationData(
// entity,
// MorphAnimationData(
// animation.toDart
// .map((x) => x.toDart.map((y) => y.toDartDouble).toList())
// .toList(),
// morphTargets.toDart.map((m) => m.toDart).toList()),
// targetMeshNames:
// targetMeshNames.toDart.map((x) => x.toDart).toList(),
// )
// .toJS;
// @JSExport()
// JSPromise resetBones(FilamentEntity entity) => viewer.resetBones(entity).toJS;
// @JSExport()
// JSPromise addBoneAnimation(FilamentEntity entity, JSObject animation) {
// throw Exception();
// }
// // viewer
// // .addBoneAnimation(
// // entity,
// // BoneAnimationData._fromJSObject(animation),
// // )
// // .toJS;
// @JSExport()
// JSPromise removeEntity(FilamentEntity entity) =>
// viewer.removeEntity(entity).toJS;
// @JSExport()
// JSPromise clearEntities() => viewer.clearEntities().toJS;
// @JSExport()
// JSPromise zoomBegin() => viewer.zoomBegin().toJS;
// @JSExport()
// JSPromise zoomUpdate(double x, double y, double z) =>
// viewer.zoomUpdate(x, y, z).toJS;
// @JSExport()
// JSPromise zoomEnd() => viewer.zoomEnd().toJS;
// @JSExport()
// JSPromise playAnimation(FilamentEntity entity, int index,
// {bool loop = false,
// bool reverse = false,
// bool replaceActive = true,
// double crossfade = 0.0}) =>
// viewer
// .playAnimation(
// entity,
// index,
// loop: loop,
// reverse: reverse,
// replaceActive: replaceActive,
// crossfade: crossfade,
// )
// .toJS;
// @JSExport()
// JSPromise playAnimationByName(FilamentEntity entity, String name,
// {bool loop = false,
// bool reverse = false,
// bool replaceActive = true,
// double crossfade = 0.0}) =>
// viewer
// .playAnimationByName(
// entity,
// name,
// loop: loop,
// reverse: reverse,
// replaceActive: replaceActive,
// crossfade: crossfade,
// )
// .toJS;
// @JSExport()
// JSPromise setAnimationFrame(
// FilamentEntity entity, int index, int animationFrame) =>
// viewer
// .setAnimationFrame(
// entity,
// index,
// animationFrame,
// )
// .toJS;
// @JSExport()
// JSPromise stopAnimation(FilamentEntity entity, int animationIndex) =>
// viewer.stopAnimation(entity, animationIndex).toJS;
// @JSExport()
// JSPromise stopAnimationByName(FilamentEntity entity, String name) =>
// viewer.stopAnimationByName(entity, name).toJS;
// @JSExport()
// JSPromise setCamera(FilamentEntity entity, String? name) =>
// viewer.setCamera(entity, name).toJS;
// @JSExport()
// JSPromise setMainCamera() => viewer.setMainCamera().toJS;
// @JSExport()
// JSPromise<JSNumber> getMainCamera() {
// return viewer.getMainCamera().then((camera) => camera.toJS).toJS;
// }
// @JSExport()
// JSPromise setCameraFov(double degrees, double width, double height) =>
// viewer.setCameraFov(degrees, width, height).toJS;
// @JSExport()
// JSPromise setToneMapping(int mapper) =>
// viewer.setToneMapping(ToneMapper.values[mapper]).toJS;
// @JSExport()
// JSPromise setBloom(double bloom) => viewer.setBloom(bloom).toJS;
// @JSExport()
// JSPromise setCameraFocalLength(double focalLength) =>
// viewer.setCameraFocalLength(focalLength).toJS;
// @JSExport()
// JSPromise setCameraCulling(double near, double far) =>
// viewer.setCameraCulling(near, far).toJS;
// @JSExport()
// JSPromise<JSNumber> getCameraCullingNear() =>
// viewer.getCameraCullingNear().then((v) => v.toJS).toJS;
// @JSExport()
// JSPromise<JSNumber> getCameraCullingFar() =>
// viewer.getCameraCullingFar().then((v) => v.toJS).toJS;
// @JSExport()
// JSPromise setCameraFocusDistance(double focusDistance) =>
// viewer.setCameraFocusDistance(focusDistance).toJS;
// @JSExport()
// JSPromise<JSArray<JSNumber>> getCameraPosition() {
// throw UnimplementedError();
// // return viewer.getCameraPosition().then((position) => position.toJS).toJS;
// }
// @JSExport()
// JSPromise<JSArray<JSNumber>> getCameraModelMatrix() {
// throw UnimplementedError();
// // return viewer.getCameraModelMatrix().then((matrix) => matrix.toJSArray<JSNumber>()).toJS;
// }
// @JSExport()
// JSPromise<JSArray<JSNumber>> getCameraViewMatrix() {
// throw UnimplementedError();
// // return viewer.getCameraViewMatrix().then((matrix) => matrix.toJSArray<JSNumber>()).toJS;
// }
// @JSExport()
// JSPromise<JSArray<JSNumber>> getCameraProjectionMatrix() {
// throw UnimplementedError();
// // return viewer.getCameraProjectionMatrix().then((matrix) => matrix.toJSArray<JSNumber>()).toJS;
// }
// @JSExport()
// JSPromise<JSArray<JSNumber>> getCameraCullingProjectionMatrix() {
// throw UnimplementedError();
// // return viewer.getCameraCullingProjectionMatrix().then((matrix) => matrix.toJSArray<JSNumber>()).toJS;
// }
// @JSExport()
// JSPromise<JSNumber> getCameraFrustum() {
// throw UnimplementedError();
// // return viewer.getCameraFrustum().then((frustum) => frustum.toJS).toJS;
// }
// @JSExport()
// JSPromise setCameraPosition(double x, double y, double z) =>
// viewer.setCameraPosition(x, y, z).toJS;
// @JSExport()
// JSPromise<JSArray<JSNumber>> getCameraRotation() {
// return viewer
// .getCameraRotation()
// .then((rotation) => rotation.storage.map((v) => v.toJS).toList().toJS)
// .toJS;
// }
// @JSExport()
// JSPromise moveCameraToAsset(FilamentEntity entity) =>
// throw UnimplementedError();
// // viewer.moveCameraToAsset(entity)).toJS;
// @JSExport()
// JSPromise setViewFrustumCulling(JSBoolean enabled) =>
// throw UnimplementedError();
// // viewer.setViewFrustumCulling(enabled).toJS;
// @JSExport()
// JSPromise setCameraExposure(
// double aperture, double shutterSpeed, double sensitivity) =>
// viewer.setCameraExposure(aperture, shutterSpeed, sensitivity).toJS;
// @JSExport()
// JSPromise setCameraRotation(JSArray<JSNumber> quaternion) =>
// throw UnimplementedError();
// // viewer.setCameraRotation(quaternion.toDartQuaternion()).toJS;
// @JSExport()
// JSPromise setCameraModelMatrix(List<double> matrix) =>
// viewer.setCameraModelMatrix(matrix).toJS;
// @JSExport()
// JSPromise setMaterialColor(FilamentEntity entity, String meshName,
// int materialIndex, double r, double g, double b, double a) =>
// throw UnimplementedError();
// // viewer.setMaterialColor(
// // entity),
// // meshName,
// // materialIndex,
// // r,
// // g,
// // b,
// // a,
// // ).toJS;
// @JSExport()
// JSPromise transformToUnitCube(FilamentEntity entity) =>
// viewer.transformToUnitCube(entity).toJS;
// @JSExport()
// JSPromise setPosition(FilamentEntity entity, double x, double y, double z) =>
// viewer.setPosition(entity, x, y, z).toJS;
// @JSExport()
// JSPromise setScale(FilamentEntity entity, double scale) =>
// viewer.setScale(entity, scale).toJS;
// @JSExport()
// JSPromise setRotation(
// FilamentEntity entity, double rads, double x, double y, double z) =>
// viewer.setRotation(entity, rads, x, y, z).toJS;
// @JSExport()
// JSPromise queuePositionUpdate(
// FilamentEntity entity, double x, double y, double z, bool relative) =>
// viewer
// .queuePositionUpdate(
// entity,
// x,
// y,
// z,
// relative: relative,
// )
// .toJS;
// @JSExport()
// JSPromise queueRotationUpdate(FilamentEntity entity, double rads, double x,
// double y, double z, bool relative) =>
// viewer
// .queueRotationUpdate(
// entity,
// rads,
// x,
// y,
// z,
// relative: relative,
// )
// .toJS;
// @JSExport()
// JSPromise queueRotationUpdateQuat(
// FilamentEntity entity, JSArray<JSNumber> quat, JSBoolean relative) =>
// throw UnimplementedError();
// // viewer.queueRotationUpdateQuat(
// // entity,
// // quat.toDartQuaternion(),
// // relative: relative,
// // ).toJS;
// @JSExport()
// JSPromise setPostProcessing(bool enabled) =>
// viewer.setPostProcessing(enabled).toJS;
// @JSExport()
// JSPromise setAntiAliasing(bool msaa, bool fxaa, bool taa) =>
// viewer.setAntiAliasing(msaa, fxaa, taa).toJS;
// @JSExport()
// JSPromise setRotationQuat(
// FilamentEntity entity, JSArray<JSNumber> rotation) =>
// throw UnimplementedError();
// // viewer.setRotationQuat(
// // entity,
// // rotation.toDartQuaternion(),
// // ).toJS;
// @JSExport()
// JSPromise reveal(FilamentEntity entity, String? meshName) =>
// viewer.reveal(entity, meshName).toJS;
// @JSExport()
// JSPromise hide(FilamentEntity entity, String? meshName) =>
// viewer.hide(entity, meshName).toJS;
// @JSExport()
// void pick(int x, int y) => viewer.pick(x, y);
// @JSExport()
// String? getNameForEntity(FilamentEntity entity) =>
// viewer.getNameForEntity(entity);
// @JSExport()
// JSPromise setCameraManipulatorOptions({
// int mode = 0,
// double orbitSpeedX = 0.01,
// double orbitSpeedY = 0.01,
// double zoomSpeed = 0.01,
// }) =>
// viewer
// .setCameraManipulatorOptions(
// mode: ManipulatorMode.values[mode],
// orbitSpeedX: orbitSpeedX,
// orbitSpeedY: orbitSpeedY,
// zoomSpeed: zoomSpeed,
// )
// .toJS;
// @JSExport()
// JSPromise<JSArray<JSNumber>> getChildEntities(
// FilamentEntity parent, bool renderableOnly) {
// return viewer
// .getChildEntities(
// parent,
// renderableOnly,
// )
// .then((entities) => entities.map((entity) => entity.toJS).toList().toJS)
// .toJS;
// }
// @JSExport()
// JSPromise<JSNumber> getChildEntity(FilamentEntity parent, String childName) {
// return viewer
// .getChildEntity(
// parent,
// childName,
// )
// .then((entity) => entity.toJS)
// .toJS;
// }
// @JSExport()
// JSPromise<JSArray<JSString>> getChildEntityNames(
// FilamentEntity entity, bool renderableOnly) =>
// viewer
// .getChildEntityNames(
// entity,
// renderableOnly: renderableOnly,
// )
// .then((v) => v.map((s) => s.toJS).toList().toJS)
// .toJS;
// @JSExport()
// JSPromise setRecording(bool recording) => viewer.setRecording(recording).toJS;
// @JSExport()
// JSPromise setRecordingOutputDirectory(String outputDirectory) =>
// viewer.setRecordingOutputDirectory(outputDirectory).toJS;
// @JSExport()
// JSPromise addAnimationComponent(FilamentEntity entity) =>
// viewer.addAnimationComponent(entity).toJS;
// @JSExport()
// JSPromise addCollisionComponent(FilamentEntity entity,
// {JSFunction? callback, bool affectsTransform = false}) {
// throw UnimplementedError();
// // final Function? dartCallback = callback != null
// // ? allowInterop((int entityId1, int entityId2) => callback.apply([entityId1, entityId2]))
// // : null;
// // return viewer.addCollisionComponent(
// // entity),
// // callback: dartCallback,
// // affectsTransform: affectsTransform,
// // ).toJs
// }
// }

View File

@@ -0,0 +1,450 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "5aaf60d96c4cd00fe7f21594b5ad6a1b699c80a27420f8a837f4d68473ef09e3"
url: "https://pub.dev"
source: hosted
version: "68.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.1.3"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "21f1d3720fd1c70316399d5e2bccaebb415c434592d778cce8acb967b8578808"
url: "https://pub.dev"
source: hosted
version: "6.5.0"
animation_tools_dart:
dependency: transitive
description:
path: "."
ref: HEAD
resolved-ref: "1a5ffc8a58353d43ba1864c8676c47948ee9b5ce"
url: "git@github.com:nmfisher/animation_tools_dart.git"
source: git
version: "0.0.2"
args:
dependency: transitive
description:
name: args
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
url: "https://pub.dev"
source: hosted
version: "2.5.0"
async:
dependency: transitive
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.18.0"
convert:
dependency: transitive
description:
name: convert
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
url: "https://pub.dev"
source: hosted
version: "3.1.1"
coverage:
dependency: transitive
description:
name: coverage
sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
crypto:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
url: "https://pub.dev"
source: hosted
version: "3.0.3"
dart_filament:
dependency: "direct main"
description:
path: "../../../../dart_filament"
relative: true
source: path
version: "0.5.0"
ffi:
dependency: transitive
description:
name: ffi
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
file:
dependency: transitive
description:
name: file
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
url: "https://pub.dev"
source: hosted
version: "4.0.0"
glob:
dependency: transitive
description:
name: glob
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b"
url: "https://pub.dev"
source: hosted
version: "3.2.1"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
io:
dependency: transitive
description:
name: io
sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
js:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
version: "0.7.1"
lints:
dependency: "direct dev"
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
url: "https://pub.dev"
source: hosted
version: "3.0.0"
logging:
dependency: transitive
description:
name: logging
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
macros:
dependency: transitive
description:
name: macros
sha256: e4a273c4a7a81fdbea1f3faed45faa6a7c0b78a50076e89d3f02350caefc8939
url: "https://pub.dev"
source: hosted
version: "0.1.0-main.3"
matcher:
dependency: transitive
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.16+1"
meta:
dependency: transitive
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.15.0"
mime:
dependency: transitive
description:
name: mime
sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
node_preamble:
dependency: transitive
description:
name: node_preamble
sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
package_config:
dependency: transitive
description:
name: package_config
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
path:
dependency: transitive
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.9.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
pool:
dependency: transitive
description:
name: pool
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
url: "https://pub.dev"
source: hosted
version: "1.5.1"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
shelf:
dependency: transitive
description:
name: shelf
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
url: "https://pub.dev"
source: hosted
version: "1.4.1"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
shelf_static:
dependency: transitive
description:
name: shelf_static
sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e
url: "https://pub.dev"
source: hosted
version: "1.1.2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
source_map_stack_trace:
dependency: transitive
description:
name: source_map_stack_trace
sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
source_maps:
dependency: transitive
description:
name: source_maps
sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703"
url: "https://pub.dev"
source: hosted
version: "0.10.12"
source_span:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.2"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted
version: "1.2.1"
test:
dependency: "direct dev"
description:
name: test
sha256: d11b55850c68c1f6c0cf00eabded4e66c4043feaf6c0d7ce4a36785137df6331
url: "https://pub.dev"
source: hosted
version: "1.25.5"
test_api:
dependency: transitive
description:
name: test_api
sha256: "2419f20b0c8677b2d67c8ac4d1ac7372d862dc6c460cdbb052b40155408cd794"
url: "https://pub.dev"
source: hosted
version: "0.7.1"
test_core:
dependency: transitive
description:
name: test_core
sha256: "4d070a6bc36c1c4e89f20d353bfd71dc30cdf2bd0e14349090af360a029ab292"
url: "https://pub.dev"
source: hosted
version: "0.6.2"
tuple:
dependency: transitive
description:
name: tuple
sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151
url: "https://pub.dev"
source: hosted
version: "2.0.2"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
url: "https://pub.dev"
source: hosted
version: "1.3.2"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "7475cb4dd713d57b6f7464c0e13f06da0d535d8b2067e188962a59bac2cf280b"
url: "https://pub.dev"
source: hosted
version: "14.2.2"
watcher:
dependency: transitive
description:
name: watcher
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web:
dependency: transitive
description:
name: web
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: bfe704c186c6e32a46f6607f94d079cd0b747b9a489fceeecc93cd3adb98edd5
url: "https://pub.dev"
source: hosted
version: "0.1.3"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: a2d56211ee4d35d9b344d9d4ce60f362e4f5d1aafb988302906bd732bc731276
url: "https://pub.dev"
source: hosted
version: "3.0.0"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
yaml:
dependency: transitive
description:
name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0-256.0.dev <4.0.0"

View File

@@ -0,0 +1,16 @@
name: web_app
description: A sample command-line application.
version: 1.0.0
# repository: https://github.com/my_org/my_repo
environment:
sdk: ^3.3.0
# Add regular dependencies here.
dependencies:
dart_filament:
path: ../../../../dart_filament
dev_dependencies:
lints: ^3.0.0
test: ^1.24.0

View File

@@ -0,0 +1,8 @@
import 'package:web_app/web_app.dart';
import 'package:test/test.dart';
void main() {
test('calculate', () {
expect(calculate(), 42);
});
}

View File

@@ -7,11 +7,8 @@
#include "generated_plugin_registrant.h"
#include <flutter_filament/flutter_filament_plugin_c_api.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
FlutterFilamentPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterFilamentPluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
}

View File

@@ -4,7 +4,6 @@
list(APPEND FLUTTER_PLUGIN_LIST
flutter_filament
permission_handler_windows
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST