Committed by
GitHub
Merge pull request #98 from hosamkora/master
add sizing extension members to num class
Showing
3 changed files
with
14 additions
and
5 deletions
| @@ -75,7 +75,7 @@ packages: | @@ -75,7 +75,7 @@ packages: | ||
| 75 | path: ".." | 75 | path: ".." |
| 76 | relative: true | 76 | relative: true |
| 77 | source: path | 77 | source: path |
| 78 | - version: "1.0.1" | 78 | + version: "1.0.2" |
| 79 | flutter_test: | 79 | flutter_test: |
| 80 | dependency: "direct dev" | 80 | dependency: "direct dev" |
| 81 | description: flutter | 81 | description: flutter |
| @@ -199,4 +199,4 @@ packages: | @@ -199,4 +199,4 @@ packages: | ||
| 199 | source: hosted | 199 | source: hosted |
| 200 | version: "3.5.0" | 200 | version: "3.5.0" |
| 201 | sdks: | 201 | sdks: |
| 202 | - dart: ">=2.4.0 <3.0.0" | 202 | + dart: ">=2.6.0 <3.0.0" |
lib/size_extension.dart
0 → 100644
| 1 | +import 'flutter_screenutil.dart'; | ||
| 2 | + | ||
| 3 | +extension SizeExtension on num { | ||
| 4 | + num get w => ScreenUtil().setWidth(this); | ||
| 5 | + | ||
| 6 | + num get h => ScreenUtil().setHeight(this); | ||
| 7 | + | ||
| 8 | + num get sp => ScreenUtil().setSp(this); | ||
| 9 | + | ||
| 10 | + num get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true); | ||
| 11 | +} |
| @@ -4,7 +4,7 @@ version: 1.0.2 | @@ -4,7 +4,7 @@ version: 1.0.2 | ||
| 4 | homepage: https://github.com/OpenFlutter/flutter_screenutil | 4 | homepage: https://github.com/OpenFlutter/flutter_screenutil |
| 5 | 5 | ||
| 6 | environment: | 6 | environment: |
| 7 | - sdk: ">=2.0.0-dev.68.0 <3.0.0" | 7 | + sdk: ">=2.6.0 <3.0.0" |
| 8 | 8 | ||
| 9 | dependencies: | 9 | dependencies: |
| 10 | flutter: | 10 | flutter: |
| @@ -19,7 +19,6 @@ dev_dependencies: | @@ -19,7 +19,6 @@ dev_dependencies: | ||
| 19 | 19 | ||
| 20 | # The following section is specific to Flutter. | 20 | # The following section is specific to Flutter. |
| 21 | flutter: | 21 | flutter: |
| 22 | - | ||
| 23 | # To add assets to your package, add an assets section, like this: | 22 | # To add assets to your package, add an assets section, like this: |
| 24 | # assets: | 23 | # assets: |
| 25 | # - images/a_dot_burr.jpeg | 24 | # - images/a_dot_burr.jpeg |
| @@ -30,7 +29,6 @@ flutter: | @@ -30,7 +29,6 @@ flutter: | ||
| 30 | # | 29 | # |
| 31 | # An image asset can refer to one or more resolution-specific "variants", see | 30 | # An image asset can refer to one or more resolution-specific "variants", see |
| 32 | # https://flutter.io/assets-and-images/#resolution-aware. | 31 | # https://flutter.io/assets-and-images/#resolution-aware. |
| 33 | - | ||
| 34 | # To add custom fonts to your package, add a fonts section here, | 32 | # To add custom fonts to your package, add a fonts section here, |
| 35 | # in this "flutter" section. Each entry in this list should have a | 33 | # in this "flutter" section. Each entry in this list should have a |
| 36 | # "family" key with the font family name, and a "fonts" key with a | 34 | # "family" key with the font family name, and a "fonts" key with a |
-
Please register or login to post a comment