Browse Source

fix gesture throw error

cjl_macbook 6 năm trước cách đây
mục cha
commit
8bd7586e8b

+ 3 - 3
example/pubspec.lock

@@ -148,7 +148,7 @@ packages:
       name: oktoast
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "2.1.6"
+    version: "2.1.7"
   package_config:
     dependency: transitive
     description:
@@ -183,14 +183,14 @@ packages:
       name: photo
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "0.3.3"
+    version: "0.3.4"
   photo_manager:
     dependency: transitive
     description:
       name: photo_manager
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "0.3.3"
+    version: "0.3.4"
   pub_semver:
     dependency: transitive
     description:

+ 2 - 2
example/pubspec.yaml

@@ -11,8 +11,8 @@ dependencies:
   # The following adds the Cupertino Icons font to your application.
   # Use with the CupertinoIcons class for iOS style icons.
   cupertino_icons: ^0.1.2
-  photo: ^0.3.3
-  oktoast: ^2.1.6
+  photo: ^0.3.4
+  oktoast: ^2.1.7
 
   flutter_localizations:
     sdk: flutter

+ 4 - 1
lib/src/widget/controller_widget_builder.dart

@@ -330,8 +330,11 @@ class _DefaultIJKControllerWidgetState extends State<DefaultIJKControllerWidget>
 
   void _onHorizontalDragEnd(DragEndDetails details) async {
     hideTooltip();
-    var targetSeek = _calculator.getTargetSeek(details);
+    var targetSeek = _calculator?.getTargetSeek(details);
     _calculator = null;
+    if (targetSeek == null) {
+      return;
+    }
     await controller.seekTo(targetSeek);
     var videoInfo = await controller.getVideoInfo();
     if (targetSeek < videoInfo.duration) await controller.play();