Simon

Update README.md

Showing 1 changed file with 22 additions and 1 deletions
@@ -41,7 +41,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -41,7 +41,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
41 ### Properties 41 ### Properties
42 42
43 | Property | Type | Default Value | Description | 43 | Property | Type | Default Value | Description |
44 -| ----------------- | ---------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | 44 +| ----------------- | ---------------- | ------------- |-----------------------------------------------------------------------------------------------------------------------------------------------|
45 | designSize | Size | Size(360,690) | The size of the device screen in the design draft, in dp | 45 | designSize | Size | Size(360,690) | The size of the device screen in the design draft, in dp |
46 | builder | Function | null | Return widget that uses the library in a property (ex: MaterialApp's theme) | 46 | builder | Function | null | Return widget that uses the library in a property (ex: MaterialApp's theme) |
47 | child | Widget | null | A part of builder that its dependencies/properties don't use the library | 47 | child | Widget | null | A part of builder that its dependencies/properties don't use the library |
@@ -52,6 +52,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -52,6 +52,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
52 | fontSizeResolver | Function | _default_ | Function that specify how font size should be adapted. Default is that font size scale with width of screen. | 52 | fontSizeResolver | Function | _default_ | Function that specify how font size should be adapted. Default is that font size scale with width of screen. |
53 | responsiveWidgets | Iterable<String> | null | List/Set of widget names that should be included in rebuilding tree. (See [How flutter_screenutil marks a widget needs build](#rebuild-list)) | 53 | responsiveWidgets | Iterable<String> | null | List/Set of widget names that should be included in rebuilding tree. (See [How flutter_screenutil marks a widget needs build](#rebuild-list)) |
54 | excludeWidgets | Iterable<String> | null | List/Set of widget names that should be excluded from rebuilding tree. | 54 | excludeWidgets | Iterable<String> | null | List/Set of widget names that should be excluded from rebuilding tree. |
  55 +| enableScaleWH | Function | null | Support enable scale width and height. |
  56 +| enableScaleText | Function | null | Support enable scale text. |
55 57
56 58
57 **Note : You must either provide builder, child or both.** 59 **Note : You must either provide builder, child or both.**
@@ -184,6 +186,25 @@ class _HomePageState extends State<HomePage> { @@ -184,6 +186,25 @@ class _HomePageState extends State<HomePage> {
184 186
185 ### API 187 ### API
186 188
  189 +#### Enable or disable scale
  190 +
  191 +```dart
  192 + Widget build(BuildContext context) {
  193 + return ScreenUtilInit(
  194 + enableScaleWH: ()=>false,
  195 + enableScaleText: ()=>false,
  196 + //...
  197 + );
  198 + }
  199 +```
  200 +
  201 +or
  202 +
  203 +```dart
  204 +ScreenUtil.enableScale(enableWH: () => false, enableText: () => false);
  205 +```
  206 +
  207 +
187 #### Pass the dp size of the design draft 208 #### Pass the dp size of the design draft
188 209
189 ```dart 210 ```dart