Skip to content

Commit

Permalink
Merge pull request OpenFlutter#98 from hosamkora/master
Browse files Browse the repository at this point in the history
add sizing extension members to num class
  • Loading branch information
lizhuoyuan authored Mar 17, 2020
2 parents 93f8dc0 + f3046b3 commit acfc24a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.1"
version: "1.0.2"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -199,4 +199,4 @@ packages:
source: hosted
version: "3.5.0"
sdks:
dart: ">=2.4.0 <3.0.0"
dart: ">=2.6.0 <3.0.0"
11 changes: 11 additions & 0 deletions lib/size_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'flutter_screenutil.dart';

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

num get h => ScreenUtil().setHeight(this);

num get sp => ScreenUtil().setSp(this);

num get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true);
}
4 changes: 1 addition & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.2
homepage: https://github.com/OpenFlutter/flutter_screenutil

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.6.0 <3.0.0"

dependencies:
flutter:
Expand All @@ -19,7 +19,6 @@ dev_dependencies:

# The following section is specific to Flutter.
flutter:

# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
Expand All @@ -30,7 +29,6 @@ flutter:
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.

# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
Expand Down

0 comments on commit acfc24a

Please sign in to comment.