thl 5 年 前
コミット
9e9c2ba141
2 ファイル変更1 行追加11 行削除
  1. 1 5
      lib/src/image_util.dart
  2. 0 6
      lib/src/widget_util.dart

+ 1 - 5
lib/src/image_util.dart

@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart';
  * @GitHub: https://github.com/Sky24n
  * @Email: sky24no@gmail.com
  * @Description: Image Util.
- * @Date: 2018/9/10
+ * @Date: 2020/03/10
  */
 
 /// Image Util.
@@ -27,12 +27,10 @@ class ImageUtil {
     String package,
     ImageConfiguration configuration,
   }) {
-    int start = DateTime.now().millisecondsSinceEpoch;
     Completer<Rect> completer = Completer<Rect>();
     _listener = ImageStreamListener(
       (ImageInfo info, bool synchronousCall) {
         int now = DateTime.now().millisecondsSinceEpoch;
-        print("thll ------------[${now - start}]---------------");
         _imageStream.removeListener(_listener);
         if (!completer.isCompleted) {
           completer.complete(Rect.fromLTWH(
@@ -40,8 +38,6 @@ class ImageUtil {
         }
       },
       onError: (dynamic exception, StackTrace stackTrace) {
-        print(
-            "thll ------------[exception]---------------${exception?.toString()}");
         _imageStream.removeListener(_listener);
         if (!completer.isCompleted) {
           completer.completeError(exception, stackTrace);

+ 0 - 6
lib/src/widget_util.dart

@@ -95,16 +95,12 @@ class WidgetUtil {
         .resolve(configuration ?? ImageConfiguration())
         .addListener(ImageStreamListener(
           (ImageInfo info, bool synchronousCall) {
-            print(
-                "thll ImageStreamListener suc...... ${completer.isCompleted}");
             if (!completer.isCompleted) {
               completer.complete(Rect.fromLTWH(0, 0,
                   info.image.width.toDouble(), info.image.height.toDouble()));
             }
           },
           onError: (dynamic exception, StackTrace stackTrace) {
-            print(
-                "thll ImageStreamListener fail...... ${completer.isCompleted}");
             if (!completer.isCompleted) {
               completer.complete(Rect.zero);
             }
@@ -146,14 +142,12 @@ class WidgetUtil {
         .resolve(configuration ?? ImageConfiguration())
         .addListener(ImageStreamListener(
           (ImageInfo info, bool synchronousCall) {
-            print("thll ImageStreamListener suc......");
             if (!completer.isCompleted) {
               completer.complete(Rect.fromLTWH(0, 0,
                   info.image.width.toDouble(), info.image.height.toDouble()));
             }
           },
           onError: (dynamic exception, StackTrace stackTrace) {
-            print("thll ImageStreamListener fail......");
             if (!completer.isCompleted) {
               completer.completeError(exception, stackTrace);
             }