Skip to content

Commit

Permalink
Merge pull request OpenFlutter#3 from sidrao2006/num-double-patch
Browse files Browse the repository at this point in the history
Change type annotations
  • Loading branch information
sidrao2006 authored Sep 30, 2020
2 parents 385943c + f8d57c3 commit 68d958e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/size_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import 'package:flutter_screenutil/screenutil.dart';

extension SizeExtension on num {
///[ScreenUtil.setWidth]
num get w => ScreenUtil().setWidth(this);
double get w => ScreenUtil().setWidth(this);

///[ScreenUtil.setHeight]
num get h => ScreenUtil().setHeight(this);
double get h => ScreenUtil().setHeight(this);

///[ScreenUtil.setSp]
num get sp => ScreenUtil().setSp(this);
double get sp => ScreenUtil().setSp(this);

///[ScreenUtil.setSp]
num get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true);
double get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true);

///[ScreenUtil.setSp]
num get nsp => ScreenUtil().setSp(this, allowFontScalingSelf: false);
double get nsp => ScreenUtil().setSp(this, allowFontScalingSelf: false);

///屏幕宽度的倍数
///Multiple of screen width
num get wp => ScreenUtil().screenWidth * this;
double get wp => ScreenUtil().screenWidth * this;

///屏幕高度的倍数
///Multiple of screen height
num get hp => ScreenUtil().screenHeight * this;
double get hp => ScreenUtil().screenHeight * this;
}

0 comments on commit 68d958e

Please sign in to comment.