Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nutil

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information
李卓原 committed Nov 24, 2021
2 parents 4dd80cd + 84c9b9a commit 003d429
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/size_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ extension SizeExtension on num {
///[ScreenUtil.setSp]
double get sp => ScreenUtil().setSp(this);

///smart size : it check your value if it is bigger than your value set your value
///for example you have set 16.sm() , if for your screen 16.sp() bigger than 16 it will set 16 not 16.sp()
///I think that it is good for save size balance on big sizes of screen
double get sm => min(toDouble(), sp);

///[ScreenUtil.setSp]
@Deprecated('please use [sp]')
double get ssp => ScreenUtil().setSp(this);
Expand Down

0 comments on commit 003d429

Please sign in to comment.