Parcourir la source

修改了包的引用

Kevin il y a 6 ans
Parent
commit
c3b4824b40
4 fichiers modifiés avec 10 ajouts et 18 suppressions
  1. 1 1
      README.md
  2. 6 7
      lib/widgets/popover/cupertino_popover.dart
  3. 1 8
      pubspec.lock
  4. 2 2
      pubspec.yaml

+ 1 - 1
README.md

@@ -7,7 +7,7 @@ Usage
 Add this to your package's pubspec.yaml file:
 ``` yaml
 dependencies:
-  cool_ui: "^0.1.9"
+  cool_ui: "^0.1.10"
 ```
 
 # 控件

+ 6 - 7
lib/widgets/popover/cupertino_popover.dart

@@ -104,8 +104,7 @@ class CupertinoPopover extends StatefulWidget {
     @required BuildContext context,
     this.doubleAnimation,
     this.radius=8.0}):super(){
-    ScreenUtil.getInstance().init(context);
-    BoxConstraints temp =  null;
+    BoxConstraints temp;
     if(constraints != null){
       temp = BoxConstraints(maxHeight:123.0,maxWidth:150.0).copyWith(
         minWidth: constraints.minWidth.isFinite?constraints.minWidth:null,
@@ -238,15 +237,15 @@ class _CupertionPopoverPositionRenderObject extends RenderShiftedBox{
   Offset calcOffset(Size size){
     double bodyLeft = 0.0;
 
-    var isArrowUp = ScreenUtil.screenHeight > attachRect.bottom + size.height + CupertinoPopoverState._arrowHeight;
+    var isArrowUp = ScreenUtil.singleton.screenHeight > attachRect.bottom + size.height + CupertinoPopoverState._arrowHeight;
 
     if(attachRect.left > size.width / 2 &&
-        ScreenUtil.screenWidth - attachRect.right > size.width / 2){ //判断是否可以在中间
+        ScreenUtil.singleton.screenWidth - attachRect.right > size.width / 2){ //判断是否可以在中间
       bodyLeft = attachRect.left +  attachRect.width / 2 - size.width / 2;
     }else if(attachRect.left < size.width / 2){ //靠左
       bodyLeft = 10.0;
     }else{ //靠右
-      bodyLeft = ScreenUtil.screenWidth - 10.0 - size.width;
+      bodyLeft = ScreenUtil.singleton.screenWidth - 10.0 - size.width;
     }
 
     if(isArrowUp){
@@ -348,7 +347,7 @@ class _CupertionPopoverContextRenderObject extends RenderShiftedBox{
     child.layout(childConstraints, parentUsesSize: true);
     size = Size(child.size.width,child.size.height + CupertinoPopoverState._arrowHeight);
     final BoxParentData childParentData = child.parentData;
-    var isArrowUp = ScreenUtil.screenHeight > attachRect.bottom + size.height + CupertinoPopoverState._arrowHeight;
+    var isArrowUp = ScreenUtil.singleton.screenHeight > attachRect.bottom + size.height + CupertinoPopoverState._arrowHeight;
     if(isArrowUp)
     {
       childParentData.offset = Offset(0.0, CupertinoPopoverState._arrowHeight);
@@ -360,7 +359,7 @@ class _CupertionPopoverContextRenderObject extends RenderShiftedBox{
     // TODO: implement paint
     Matrix4 transform = Matrix4.identity();
 //
-    var isArrowUp = ScreenUtil.screenHeight > attachRect.bottom + size.height + CupertinoPopoverState._arrowHeight;
+    var isArrowUp = ScreenUtil.singleton.screenHeight > attachRect.bottom + size.height + CupertinoPopoverState._arrowHeight;
 
     var arrowLeft =attachRect.left + attachRect.width / 2 - CupertinoPopoverState._arrowWidth / 2 - offset.dx;
     var translation = Offset(arrowLeft + CupertinoPopoverState._arrowWidth / 2,isArrowUp?0.0:size.height);

+ 1 - 8
pubspec.lock

@@ -29,20 +29,13 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "1.14.11"
-  cupertino_icons:
-    dependency: "direct main"
-    description:
-      name: cupertino_icons
-      url: "https://pub.flutter-io.cn"
-    source: hosted
-    version: "0.1.2"
   flustars:
     dependency: "direct main"
     description:
       name: flustars
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "0.1.3"
+    version: "0.1.4"
   flutter:
     dependency: "direct main"
     description: flutter

+ 2 - 2
pubspec.yaml

@@ -1,6 +1,6 @@
 name: cool_ui
 description: 用flutter实现一些我认为好看的UI控件,目前暂时只有Popover,Weui,Custom Keyboard,不过有什么觉得好看的可以提Issue
-version: 0.1.9
+version: 0.1.10
 author: Kevin <liangkaikevin@gmail.com>
 homepage: https://github.com/Im-Kevin/cool_ui
 
@@ -11,7 +11,7 @@ dependencies:
   flutter:
     sdk: flutter
 
-  flustars: 0.1.3
+  flustars: ^0.1.4
 
 dev_dependencies:
   flutter_test: