Skip to content

Commit 8d77ab8

Browse files
FarazFaraz
authored andcommitted
Merge branch 'refs/heads/dev'
# Conflicts: # .flutter-plugins-dependencies
2 parents 82b5e70 + e04f5e9 commit 8d77ab8

File tree

7 files changed

+29
-7
lines changed

7 files changed

+29
-7
lines changed

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"webview_flutter_wkwebview","path":"/Users/faraz/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.14.0/","native_build":true,"dependencies":[]}],"android":[{"name":"webview_flutter_android","path":"/Users/faraz/.pub-cache/hosted/pub.dev/webview_flutter_android-3.16.8/","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2024-10-14 18:28:43.470225","version":"3.22.3"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"webview_flutter_wkwebview","path":"/Users/faraz/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.14.0/","native_build":true,"dependencies":[]}],"android":[{"name":"webview_flutter_android","path":"/Users/faraz/.pub-cache/hosted/pub.dev/webview_flutter_android-3.16.8/","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2025-01-02 01:57:50.969940","version":"3.22.3"}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v2.0.3
2+
3+
### Fixes
4+
* Fix onLoad callback delay
5+
* Fix iOS text select on 3d model
6+
7+
18
## v2.0.2
29

310
### Fixes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Flutter3DViewer.obj(
176176

177177
```yaml
178178
dependencies:
179-
flutter_3d_controller: ^2.0.2
179+
flutter_3d_controller: ^2.0.3
180180
```
181181
182182
### `AndroidManifest.xml` (Android only)

assets/model_viewer_template.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
height: 100%;
77
margin: 0;
88
padding: 0;
9+
10+
/* Prevent iOS context menu */
11+
-webkit-touch-callout: none;
12+
13+
/* Prevent text selection */
14+
-webkit-user-select: none;
15+
-khtml-user-select: none;
16+
-moz-user-select: none;
17+
-ms-user-select: none;
18+
user-select: none;
19+
20+
/* Allow native touch actions like zooming and scrolling */
21+
touch-action: none;
922
}
1023

1124
/* other-css */

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ class _MyHomePageState extends State<MyHomePage> {
197197
//This callBack will call after model loaded successfully and will return model address
198198
onLoad: (String modelAddress) {
199199
debugPrint('model loaded : $modelAddress');
200+
controller.playAnimation();
200201
},
201202
//this callBack will call when model failed to load and will return failure error
202203
onError: (String error) {

lib/src/core/modules/model_viewer/model_viewer_mobile.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,16 @@ class ModelViewerState extends State<ModelViewer> {
187187
// onLoad Channel
188188
webViewController.addJavaScriptChannel(
189189
'onLoadChannel',
190-
onMessageReceived: (message) {
191-
widget.onProgress?.call(1.0);
192-
widget.onLoad
193-
?.call(message.message == '/model' ? widget.src : message.message);
190+
onMessageReceived: (message)async{
194191
if (widget.activeGestureInterceptor && !isLoaded) {
195192
initGestureInterceptorJs('flutter-3d-controller');
196193
setGestureInterceptorLayer('flutter-3d-controller');
197194
registerGestureInterceptorListener('flutter-3d-controller');
198195
}
196+
await Future.delayed(const Duration(milliseconds: 100));
197+
widget.onProgress?.call(1.0);
198+
widget.onLoad
199+
?.call(message.message == '/model' ? widget.src : message.message);
199200
isLoaded = true;
200201
},
201202
);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_3d_controller
22
description: The most complete Flutter package for rendering interactive 3D models in various formats (GLB, GLTF, OBJ, FBX), with the ability to control animations, textures, camera, and more.
3-
version: 2.0.2
3+
version: 2.0.3
44
homepage: https://github.com/m-r-davari/flutter_3d_controller
55

66
topics:

0 commit comments

Comments
 (0)