李卓原

添加文字适配

... ... @@ -6,9 +6,20 @@
</configurations>
</component>
<component name="ChangeListManager">
<list default="true" id="4b1e7c8a-90e5-4705-b34f-bcaa595e12fe" name="Default" comment="example">
<list default="true" id="4b1e7c8a-90e5-4705-b34f-bcaa595e12fe" name="Default" comment="添加文字适配">
<change afterPath="$PROJECT_DIR$/demo_en.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/demo_zh.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/lib/main_zh.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README_CN.md" beforeDir="false" afterPath="$PROJECT_DIR$/README_CN.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/demo.PNG" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/effect.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/example/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/example/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/main.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/flutter_screenutil.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/flutter_screenutil.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -22,8 +33,8 @@
<file leaf-file-name="main.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2004">
<caret line="5" column="37" lean-forward="true" selection-start-line="5" selection-start-column="37" selection-end-line="5" selection-end-column="37" />
<state relative-caret-position="285">
<caret line="29" column="2" selection-start-line="29" selection-start-column="2" selection-end-line="29" selection-end-column="2" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
... ... @@ -40,20 +51,32 @@
</provider>
</entry>
</file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.md">
<file leaf-file-name="main_zh.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/main_zh.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="445">
<caret line="124" column="3" lean-forward="true" selection-start-line="124" selection-start-column="3" selection-end-line="124" selection-end-column="3" />
<state relative-caret-position="69">
<caret line="29" selection-start-line="29" selection-end-line="29" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<file leaf-file-name="flutter_screenutil.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/flutter_screenutil.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="194">
<caret line="69" column="17" lean-forward="true" selection-start-line="69" selection-start-column="17" selection-end-line="69" selection-end-column="17" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="162">
<caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
<state relative-caret-position="42">
<caret line="89" column="10" lean-forward="true" selection-start-line="89" selection-start-column="10" selection-end-line="89" selection-end-column="10" />
</state>
</provider>
</entry>
... ... @@ -61,8 +84,26 @@
<file leaf-file-name="README_CN.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README_CN.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="5" lean-forward="true" selection-start-line="5" selection-end-line="5" />
<state relative-caret-position="183">
<caret line="47" column="24" lean-forward="true" selection-start-line="47" selection-start-column="24" selection-end-line="47" selection-end-column="24" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="2" column="23" lean-forward="true" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="2" column="37" lean-forward="true" selection-start-line="2" selection-start-column="37" selection-end-line="2" selection-end-column="37" />
</state>
</provider>
</entry>
... ... @@ -94,20 +135,23 @@
<list>
<option value="$PROJECT_DIR$/example/lib/flutter_screenutil.dart" />
<option value="$USER_HOME$/AppData/Roaming/Pub/Cache/git/flutter_screenUtil-62d8b7d3a3cc4323eca1682166d7aee2890b1468/lib/flutter_screenutil.dart" />
<option value="$PROJECT_DIR$/lib/flutter_screenutil.dart" />
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
<option value="$PROJECT_DIR$/example/test/widget_test.dart" />
<option value="$PROJECT_DIR$/LICENSE" />
<option value="$PROJECT_DIR$/README-EN.md" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/lib/flutter_screenutil.dart" />
<option value="$PROJECT_DIR$/example/lib/main_en.dart" />
<option value="$PROJECT_DIR$/example/README.md" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/README_CN.md" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/example/lib/main_zh.dart" />
<option value="$PROJECT_DIR$/example/lib/main.dart" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<component name="ProjectFrameBounds">
<option name="x" value="-9" />
<option name="width" value="1540" />
<option name="height" value="1045" />
... ... @@ -143,6 +187,11 @@
</path>
<path>
<item name="flutter_ScreenUtil" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_ScreenUtil" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_ScreenUtil" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
</path>
</expand>
... ... @@ -168,117 +217,6 @@
<recent name="F:\screenutil" />
</key>
</component>
<component name="RestoreUpdateTree" date="Moments ago" ActionInfo="_Update">
<UpdatedFiles>
<FILE-GROUP>
<option name="myUpdateName" value="Updated from server" />
<option name="myStatusName" value="Changed on server" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="CHANGED_ON_SERVER" />
<FILE-GROUP>
<option name="myUpdateName" value="Updated" />
<option name="myStatusName" value="Changed" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="UPDATED" />
<PATH vcs="Git" revision="">$PROJECT_DIR$/README.md</PATH>
<PATH vcs="Git" revision="">$PROJECT_DIR$/README_CN.md</PATH>
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Created" />
<option name="myStatusName" value="Created" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="CREATED" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Deleted" />
<option name="myStatusName" value="Deleted" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="true" />
<option name="myId" value="REMOVED_FROM_REPOSITORY" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Restored" />
<option name="myStatusName" value="Will be restored" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="RESTORED" />
</FILE-GROUP>
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Modified" />
<option name="myStatusName" value="Modified" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="MODIFIED" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Skipped" />
<option name="myStatusName" value="Skipped" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="SKIPPED" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Merged with conflicts" />
<option name="myStatusName" value="Will be merged with conflicts" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="MERGED_WITH_CONFLICTS" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Merged with tree conflicts" />
<option name="myStatusName" value="Merged with tree conflicts" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="MERGED_WITH_TREE_CONFLICT" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Merged with property conflicts" />
<option name="myStatusName" value="Will be merged with property conflicts" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="MERGED_WITH_PROPERTY_CONFLICT" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Merged" />
<option name="myStatusName" value="Will be merged" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="MERGED" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Not in repository" />
<option name="myStatusName" value="Not in repository" />
<option name="mySupportsDeletion" value="true" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="UNKNOWN" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Locally added" />
<option name="myStatusName" value="Locally added" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="LOCALLY_ADDED" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Locally removed" />
<option name="myStatusName" value="Locally removed" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="LOCALLY_REMOVED" />
</FILE-GROUP>
<FILE-GROUP>
<option name="myUpdateName" value="Switched" />
<option name="myStatusName" value="Switched" />
<option name="mySupportsDeletion" value="false" />
<option name="myCanBeAbsent" value="false" />
<option name="myId" value="SWITCHED" />
</FILE-GROUP>
</UpdatedFiles>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
... ... @@ -291,13 +229,16 @@
</list>
</option>
</component>
<component name="RunManager">
<component name="RunManager" selected="Flutter.main.dart">
<configuration default="true" type="Application" factoryName="Application">
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
</configuration>
<configuration name="main.dart" type="FlutterRunConfigurationType" factoryName="Flutter" temporary="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/example/lib/main.dart" />
</configuration>
<configuration name="main_zh.dart" type="FlutterRunConfigurationType" factoryName="Flutter" temporary="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$/example/lib/main_zh.dart" />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
... ... @@ -353,9 +294,14 @@
<configuration name="&lt;template&gt;" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
</configuration>
<list>
<item itemvalue="Flutter.main.dart" />
<item itemvalue="Flutter.main_zh.dart" />
</list>
<recent_temporary>
<list>
<item itemvalue="Flutter.main.dart" />
<item itemvalue="Flutter.main_zh.dart" />
</list>
</recent_temporary>
</component>
... ... @@ -541,24 +487,33 @@
<option name="localTasksCounter" value="25" />
<servers />
</component>
<component name="TodoView" selected-index="4">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<frame x="-9" y="0" width="1540" height="1045" extended-state="0" />
<editor active="true" />
<layout>
<window_info anchor="bottom" id="TODO" order="6" />
<window_info active="true" anchor="bottom" id="Messages" order="8" sideWeight="0.49573562" visible="true" weight="0.3293348" />
<window_info active="true" anchor="bottom" id="TODO" order="6" visible="true" weight="0.3289183" />
<window_info anchor="right" id="Palette&#9;" order="4" />
<window_info id="Image Layers" order="3" />
<window_info anchor="right" id="Capture Analysis" order="4" />
<window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.5042644" side_tool="true" weight="0.3297062" />
<window_info anchor="bottom" id="Dart Analysis" order="8" weight="0.3297062" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3293348" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3289183" />
<window_info anchor="bottom" id="Version Control" order="8" weight="0.32861805" />
<window_info anchor="bottom" id="Terminal" order="8" sideWeight="0.49573562" weight="0.32824427" />
<window_info anchor="right" id="Flutter Outline" order="4" />
<window_info id="Capture Tool" order="3" />
<window_info id="Designer" order="3" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.31689188" />
<window_info anchor="bottom" id="Find" order="1" weight="0.3289183" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="right" id="Fabric" order="4" />
<window_info anchor="right" id="Theme Preview" order="4" />
... ... @@ -570,10 +525,10 @@
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info id="Build Variants" order="3" side_tool="true" />
<window_info anchor="bottom" id="Android Profiler" order="8" show_stripe_button="false" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="bottom" id="Logcat" order="8" />
<window_info active="true" anchor="bottom" id="Messages" order="8" sideWeight="0.49573562" visible="true" weight="0.3293348" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Device File Explorer" order="4" side_tool="true" />
... ... @@ -595,7 +550,8 @@
<MESSAGE value="0.2.2" />
<MESSAGE value="readme" />
<MESSAGE value="example" />
<option name="LAST_COMMIT_MESSAGE" value="example" />
<MESSAGE value="添加文字适配" />
<option name="LAST_COMMIT_MESSAGE" value="添加文字适配" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
... ... @@ -603,21 +559,6 @@
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/example/lib/flutter_screenutil.dart" />
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2457">
<caret line="91" column="29" lean-forward="true" selection-start-line="91" selection-start-column="29" selection-end-line="91" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README_CN.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3240">
<caret line="120" column="6" selection-start-line="120" selection-start-column="6" selection-end-line="120" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="432">
... ... @@ -842,13 +783,6 @@
</state>
</provider>
</entry>
<entry file="file://D:/flutter/packages/flutter/lib/src/widgets/media_query.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="250">
<caret line="61" column="88" selection-start-line="61" selection-start-column="72" selection-end-line="61" selection-end-column="88" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.flutter-io.cn/common_utils-1.0.2/lib/src/screen_util.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="570">
... ... @@ -857,13 +791,6 @@
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/flutter_screenutil.dart" />
<entry file="file://$PROJECT_DIR$/lib/flutter_screenutil.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="697">
<caret line="70" column="26" selection-start-line="70" selection-start-column="26" selection-end-line="70" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
... ... @@ -884,43 +811,79 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/effect.png">
<entry file="file://$PROJECT_DIR$/demo_en.png">
<provider selected="true" editor-type-id="images">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<entry file="file://$PROJECT_DIR$/demo.PNG">
<provider selected="true" editor-type-id="images">
<state />
</provider>
</entry>
<entry file="file://D:/flutter/packages/flutter/lib/src/widgets/media_query.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="140">
<caret line="86" column="5" lean-forward="true" selection-start-line="86" selection-start-column="5" selection-end-line="86" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="2" column="14" lean-forward="true" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
<caret line="2" column="37" lean-forward="true" selection-start-line="2" selection-start-column="37" selection-end-line="2" selection-end-column="37" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README_CN.md">
<entry file="file://$PROJECT_DIR$/example/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="5" lean-forward="true" selection-start-line="5" selection-end-line="5" />
<state relative-caret-position="54">
<caret line="2" column="23" lean-forward="true" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/flutter_screenutil.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="194">
<caret line="69" column="17" lean-forward="true" selection-start-line="69" selection-start-column="17" selection-end-line="69" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="445">
<caret line="124" column="3" lean-forward="true" selection-start-line="124" selection-start-column="3" selection-end-line="124" selection-end-column="3" />
<state relative-caret-position="42">
<caret line="89" column="10" lean-forward="true" selection-start-line="89" selection-start-column="10" selection-end-line="89" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<entry file="file://$PROJECT_DIR$/README_CN.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="183">
<caret line="47" column="24" lean-forward="true" selection-start-line="47" selection-start-column="24" selection-end-line="47" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="162">
<caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
<state relative-caret-position="54">
<caret line="2" column="14" lean-forward="true" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/main_zh.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69">
<caret line="29" selection-start-line="29" selection-end-line="29" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2004">
<caret line="5" column="37" lean-forward="true" selection-start-line="5" selection-start-column="37" selection-end-line="5" selection-end-column="37" />
<state relative-caret-position="285">
<caret line="29" column="2" selection-start-line="29" selection-start-column="2" selection-end-line="29" selection-end-column="2" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
... ...
... ... @@ -4,3 +4,4 @@
## [0.2.2] - Optimize documentation
## [0.3.0] - Add font size adaptation
\ No newline at end of file
... ...
... ... @@ -37,7 +37,7 @@ ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
### Use:
Fit size:
Adapt screen size:
```
Pass the px size of the design draft:
... ... @@ -52,6 +52,22 @@ Container(
),
```
Adapter font:
```
ScreenUtil().setSp(28) //Incoming font size,the unit is pixel, fonts will scale to respect Text Size accessibility settings
ScreenUtil().setSp(28,false) //Incoming font size,the unit is pixel,fonts will not scale to respect Text Size accessibility settings
for example:
Text(
'My font size is 28px and will not change with the system.',
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil().setSp(28, false)
)
),
```
Other related apis:
```
ScreenUtil.pixelRatio //Device pixel density
... ... @@ -73,15 +89,21 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
@override
Widget build(BuildContext context) {
//Set the fit size (fill in the screen size of the device in the design) If the design is based on the size of the iPhone6 ​​(iPhone6 ​​750*1334)
//设置适配尺寸 (填入设计稿中设备的屏幕尺寸) 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334)
ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
print('Device width:${ScreenUtil.screenWidth}'); //Device width
print('Device height:${ScreenUtil.screenHeight}'); //Device height
print('Device pixel density:${ScreenUtil.pixelRatio}'); //Device pixel density
print('Bottom safe zone distance:${ScreenUtil.bottomBarHeight}'); //Bottom safe zone distance,suitable for buttons with full screen
print('Status bar height:${ScreenUtil.statusBarHeight}px'); //Status bar height , Notch will be higher Unit px
print('The width is enlarged relative to the design draft:${ScreenUtil().scaleWidth}'); //The width is enlarged relative to the design draft
print('Height relative to the magnification of the design draft:${ScreenUtil().scaleHeight}'); //Height relative to the magnification of the design draft
print(
'Device pixel density:${ScreenUtil.pixelRatio}'); //Device pixel density
print(
'Bottom safe zone distance:${ScreenUtil.bottomBarHeight}'); //Bottom safe zone distance,suitable for buttons with full screen
print(
'Status bar height:${ScreenUtil.statusBarHeight}px'); //Status bar height , Notch will be higher Unit px
print(
'Width is enlarged relative to the design draft:${ScreenUtil().scaleWidth}'); //The width is enlarged relative to the design draft
print(
'Height is enlarged relative to the design draft:${ScreenUtil().scaleHeight}'); //The height is enlarged relative to the design draft
print('System font scaling:${ScreenUtil.textScaleFactory}');
return new Scaffold(
appBar: new AppBar(
... ... @@ -89,6 +111,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
),
body: new Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(
children: <Widget>[
... ... @@ -98,7 +121,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
color: Colors.red,
child: Text(
'My width:${ScreenUtil().setWidth(375)}dp',
style: TextStyle(color: Colors.white),
style: TextStyle(
color: Colors.white,
fontSize: ScreenUtil().setSp(28, false)),
),
),
Container(
... ... @@ -106,7 +131,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
height: ScreenUtil().setHeight(200),
color: Colors.blue,
child: Text('My width:${ScreenUtil().setWidth(375)}dp',
style: TextStyle(color: Colors.white)),
style: TextStyle(
color: Colors.white,
fontSize: ScreenUtil().setSp(28, false))),
),
],
),
... ... @@ -115,8 +142,31 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
Text('Device pixel density:${ScreenUtil.pixelRatio}'),
Text('Bottom safe zone distance:${ScreenUtil.bottomBarHeight}px'),
Text('Status bar height:${ScreenUtil.statusBarHeight}px'),
Text('The width is enlarged relative to the design draft:${ScreenUtil().scaleWidth}'),
Text('Height relative to the magnification of the design draft:${ScreenUtil().scaleHeight}'),
Text(
'Width is enlarged relative to the design draft:${ScreenUtil().scaleWidth}',
textAlign: TextAlign.center,
),
Text(
'Height is enlarged relative to the design draft:${ScreenUtil().scaleHeight}',
textAlign: TextAlign.center,
),
SizedBox(
height: ScreenUtil().setHeight(200),
),
Text('System font scaling:${ScreenUtil.textScaleFactory}'),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'My font size is 28px and will not change with the system.',
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil().setSp(28, false))),
Text('My font size is 28px and will change with the system.',
style: TextStyle(
color: Colors.black, fontSize: ScreenUtil().setSp(28))),
],
)
],
),
),
... ... @@ -126,9 +176,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
### example:
[example demo](https://github.com/OpenFlutter/flutter_ScreenUtil/blob/master/example)
[example demo](https://github.com/OpenFlutter/flutter_ScreenUtil/blob/master/example/lib/main_zh.dart)
effect:
![效果](effect.png)
![效果](demo_en.png)
... ...
... ... @@ -45,6 +45,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
//传入设计稿的px尺寸:
适配后的宽度width: ScreenUtil().setWidth(540),
适配后的高度height: ScreenUtil().setHeight(200),
高度也根据setWidth来做适配可以保证不变形
例如:
Container(
... ... @@ -53,17 +54,34 @@ Container(
),
```
适配字体:
```
ScreenUtil().setSp(28) //传入字体大小,根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28,false) //传入字体大小,不会根据系统的“字体大小”辅助选项来进行缩放
for example:
Text(
'My font size is 28px and will not change with the system.',
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil().setSp(28, false)
)
),
```
其他相关api:
```
ScreenUtil.pixelRatio //设备的像素密度
ScreenUtil.screenWidth //设备宽度
ScreenUtil.screenHeight //设备高度
ScreenUtil.bottomBarHeight //底部安全区距离,适用于全面屏下面有按键的
ScreenUtil.statusBarHeight //状态栏高度 刘海屏会更高 单位px
ScreenUtil().scaleWidth //宽度相对于设计稿放大的倍数
ScreenUtil.screenWidth //设备宽度
ScreenUtil.screenHeight //设备高度
ScreenUtil.bottomBarHeight //底部安全区距离,适用于全面屏下面有按键的
ScreenUtil.statusBarHeight //状态栏高度 刘海屏会更高 单位px
ScreenUtil.textScaleFactory //系统字体缩放比例
ScreenUtil().scaleWidth //宽度相对于设计稿放大的倍数
ScreenUtil().scaleHeight //高度相对于设计稿放大的倍数
```
```
... ... @@ -72,64 +90,97 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
...
@override
Widget build(BuildContext context) {
//设置适配尺寸 (填入设计稿中设备的屏幕尺寸) 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334)
ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
print('设备宽度:${ScreenUtil.screenWidth}'); //设备宽度
print('设备高度:${ScreenUtil.screenHeight}'); //设备高度
print('设备的像素密度:${ScreenUtil.pixelRatio}'); //设备的像素密度
print('底部安全区距离:${ScreenUtil.bottomBarHeight}'); //底部安全区距离,适用于全面屏下面有按键的
print('状态栏高度:${ScreenUtil.statusBarHeight}px'); //状态栏高度 刘海屏会更高
print('宽度相对于设计稿放大的倍数:${ScreenUtil().scaleWidth}'); //宽度相对于设计稿放大的倍数
print('高度相对于设计稿放大的倍数:${ScreenUtil().scaleHeight}'); //高度相对于设计稿放大的倍数
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Center(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(375),
height: ScreenUtil().setHeight(200),
color: Colors.red,
child: Text(
'我的宽度${ScreenUtil().setWidth(375)}dp',
style: TextStyle(color: Colors.white),
),
),
Container(
width: ScreenUtil().setWidth(375),
height: ScreenUtil().setHeight(200),
color: Colors.blue,
child: Text('我的宽度${ScreenUtil().setWidth(375)}dp',
style: TextStyle(color: Colors.white)),
),
],
),
Text('设备的屏幕宽度:${ScreenUtil.screenWidth}px'),
Text('设备的屏幕高度:${ScreenUtil.screenHeight}px'),
Text('设备的像素密度:${ScreenUtil.pixelRatio}'),
Text('底部安全区距离:${ScreenUtil.bottomBarHeight}px'),
Text('状态栏高度:${ScreenUtil.statusBarHeight}px'),
Text('宽度相对于设计稿放大的倍数:${ScreenUtil().scaleWidth}'),
Text('高度相对于设计稿放大的倍数:${ScreenUtil().scaleHeight}'),
],
),
),
);
}
@override
Widget build(BuildContext context) {
//设置适配尺寸 (填入设计稿中设备的屏幕尺寸) 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334)
ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
print('设备宽度:${ScreenUtil.screenWidth}'); //Device width
print('设备高度:${ScreenUtil.screenHeight}'); //Device height
print('设备的像素密度:${ScreenUtil.pixelRatio}'); //Device pixel density
print(
'底部安全区距离:${ScreenUtil.bottomBarHeight}'); //Bottom safe zone distance,suitable for buttons with full screen
print(
'状态栏高度:${ScreenUtil.statusBarHeight}px'); //Status bar height , Notch will be higher Unit px
print(
'宽度相对于设计稿放大的倍数:${ScreenUtil().scaleWidth}'); //The width is enlarged relative to the design draft
print(
'高度相对于设计稿放大的倍数:${ScreenUtil().scaleHeight}'); //The height is enlarged relative to the design draft
print('系统的字体缩放比例:${ScreenUtil.textScaleFactory}');
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(375),
height: ScreenUtil().setHeight(200),
color: Colors.red,
child: Text(
'My width:${ScreenUtil().setWidth(375)}dp',
style: TextStyle(
color: Colors.white,
fontSize: ScreenUtil().setSp(28, false)),
),
),
Container(
width: ScreenUtil().setWidth(375),
height: ScreenUtil().setHeight(200),
color: Colors.blue,
child: Text('My width:${ScreenUtil().setWidth(375)}dp',
style: TextStyle(
color: Colors.white,
fontSize: ScreenUtil().setSp(28, false))),
),
],
),
Text('Device width:${ScreenUtil.screenWidth}px'),
Text('Device height:${ScreenUtil.screenHeight}px'),
Text('Device pixel density:${ScreenUtil.pixelRatio}'),
Text('Bottom safe zone distance:${ScreenUtil.bottomBarHeight}px'),
Text('Status bar height:${ScreenUtil.statusBarHeight}px'),
Text(
'Width is enlarged relative to the design draft:${ScreenUtil().scaleWidth}',
textAlign: TextAlign.center,
),
Text(
'Height is enlarged relative to the design draft:${ScreenUtil().scaleHeight}',
textAlign: TextAlign.center,
),
SizedBox(
height: ScreenUtil().setHeight(200),
),
Text('System font scaling:${ScreenUtil.textScaleFactory}'),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'我的文字大小是28px,不会随着系统的文字大小变化',
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil().setSp(28, false))),
Text('我的文字大小是28px,会随着系统的文字大小变化',
style: TextStyle(
color: Colors.black, fontSize: ScreenUtil().setSp(28))),
],
)
],
),
),
);
}
```
### 使用示例:
[example demo](/example)
[example demo](/example/lib/main_zh.dart)
效果:
![效果](demo.PNG)
![效果](demo_zh.png)
... ...

79.9 KB

85.3 KB

... ... @@ -2,8 +2,8 @@
flutter_screenutil的使用示例
![效果](../demo.PNG)
![effect](../effect.png)
![效果](../demo_zh.png)
![effect](../demo_en.png)
## Getting Started
... ...
... ... @@ -28,22 +28,22 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
//设置适配尺寸 (填入设计稿中设备的屏幕尺寸) 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334)
ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
print('设备宽度:${ScreenUtil.screenWidth}'); //Device width
print('设备高度:${ScreenUtil.screenHeight}'); //Device height
print('设备的像素密度:${ScreenUtil.pixelRatio}'); //Device pixel density
print('底部安全区距离:${ScreenUtil.bottomBarHeight}'); //Bottom safe zone distance,suitable for buttons with full screen
print('状态栏高度:${ScreenUtil.statusBarHeight}px'); //Status bar height , Notch will be higher Unit px
print('宽度相对于设计稿放大的倍数:${ScreenUtil().scaleWidth}'); //The width is enlarged relative to the design draft
print('高度相对于设计稿放大的倍数:${ScreenUtil().scaleHeight}'); //The height is enlarged relative to the design draft
print('Device width:${ScreenUtil.screenWidth}'); //Device width
print('Device height:${ScreenUtil.screenHeight}'); //Device height
print(
'Device pixel density:${ScreenUtil.pixelRatio}'); //Device pixel density
print(
'Bottom safe zone distance:${ScreenUtil.bottomBarHeight}'); //Bottom safe zone distance,suitable for buttons with full screen
print(
'Status bar height:${ScreenUtil.statusBarHeight}px'); //Status bar height , Notch will be higher Unit px
print(
'Width is enlarged relative to the design draft:${ScreenUtil().scaleWidth}'); //The width is enlarged relative to the design draft
print(
'Height is enlarged relative to the design draft:${ScreenUtil().scaleHeight}'); //The height is enlarged relative to the design draft
print('System font scaling:${ScreenUtil.textScaleFactory}');
return new Scaffold(
appBar: new AppBar(
... ... @@ -51,6 +51,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
body: new Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(
children: <Widget>[
... ... @@ -60,7 +61,9 @@ class _MyHomePageState extends State<MyHomePage> {
color: Colors.red,
child: Text(
'My width:${ScreenUtil().setWidth(375)}dp',
style: TextStyle(color: Colors.white),
style: TextStyle(
color: Colors.white,
fontSize: ScreenUtil().setSp(28, false)),
),
),
Container(
... ... @@ -68,7 +71,9 @@ class _MyHomePageState extends State<MyHomePage> {
height: ScreenUtil().setHeight(200),
color: Colors.blue,
child: Text('My width:${ScreenUtil().setWidth(375)}dp',
style: TextStyle(color: Colors.white)),
style: TextStyle(
color: Colors.white,
fontSize: ScreenUtil().setSp(28, false))),
),
],
),
... ... @@ -85,8 +90,24 @@ class _MyHomePageState extends State<MyHomePage> {
'Height is enlarged relative to the design draft:${ScreenUtil().scaleHeight}',
textAlign: TextAlign.center,
),
SizedBox(
height: ScreenUtil().setHeight(200),
),
Text('System font scaling:${ScreenUtil.textScaleFactory}'),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'My font size is 28px and will not change with the system.',
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil().setSp(28, false))),
Text('My font size is 28px and will change with the system.',
style: TextStyle(
color: Colors.black, fontSize: ScreenUtil().setSp(28))),
],
)
],
crossAxisAlignment: CrossAxisAlignment.center,
),
),
);
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
//设置适配尺寸 (填入设计稿中设备的屏幕尺寸) 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334)
ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
print('设备宽度:${ScreenUtil.screenWidth}'); //Device width
print('设备高度:${ScreenUtil.screenHeight}'); //Device height
print('设备的像素密度:${ScreenUtil.pixelRatio}'); //Device pixel density
print(
'底部安全区距离:${ScreenUtil.bottomBarHeight}'); //Bottom safe zone distance,suitable for buttons with full screen
print(
'状态栏高度:${ScreenUtil.statusBarHeight}px'); //Status bar height , Notch will be higher Unit px
print(
'宽度相对于设计稿放大的倍数:${ScreenUtil().scaleWidth}'); //The width is enlarged relative to the design draft
print(
'高度相对于设计稿放大的倍数:${ScreenUtil().scaleHeight}'); //The height is enlarged relative to the design draft
print('系统的字体缩放比例:${ScreenUtil.textScaleFactory}');
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(375),
height: ScreenUtil().setHeight(200),
color: Colors.red,
child: Text(
'我的宽度:${ScreenUtil().setWidth(375)}dp',
style: TextStyle(
color: Colors.white,
fontSize: ScreenUtil().setSp(28, false)),
),
),
Container(
width: ScreenUtil().setWidth(375),
height: ScreenUtil().setHeight(200),
color: Colors.blue,
child: Text('我的宽度:${ScreenUtil().setWidth(375)}dp',
style: TextStyle(
color: Colors.white,
fontSize: ScreenUtil().setSp(28, false))),
),
],
),
Text('设备宽度:${ScreenUtil.screenWidth}px'),
Text('设备高度:${ScreenUtil.screenHeight}px'),
Text('设备的像素密度:${ScreenUtil.pixelRatio}'),
Text('底部安全区距离:${ScreenUtil.bottomBarHeight}px'),
Text('状态栏高度:${ScreenUtil.statusBarHeight}px'),
Text(
'宽度相对于设计稿放大的倍数:${ScreenUtil().scaleWidth}',
textAlign: TextAlign.center,
),
Text(
'高度相对于设计稿放大的倍数:${ScreenUtil().scaleHeight}',
textAlign: TextAlign.center,
),
SizedBox(
height: ScreenUtil().setHeight(200),
),
Text('系统的字体缩放比例:${ScreenUtil.textScaleFactory}'),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('我的文字大小是28px,不会随着系统的文字大小变化',
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil().setSp(28, false))),
Text('我的文字大小是28px,会随着系统的文字大小变化',
style: TextStyle(
color: Colors.black, fontSize: ScreenUtil().setSp(28))),
],
)
],
),
),
);
}
}
... ...
... ... @@ -10,7 +10,6 @@ class ScreenUtil {
//设计稿的设备尺寸修改
int _designWidth;
int _designHeight;
static MediaQueryData _mediaQueryData;
... ... @@ -21,6 +20,8 @@ class ScreenUtil {
static double _bottomBarHeight;
static double _textScaleFactor;
ScreenUtil({int width, int height}) {
_designWidth = width;
_designHeight = height;
... ... @@ -38,10 +39,14 @@ class ScreenUtil {
_screenHeight = mediaQuery.size.height;
_statusBarHeight = mediaQuery.padding.top;
_bottomBarHeight = _mediaQueryData.padding.bottom;
_textScaleFactor = mediaQuery.textScaleFactor;
}
static MediaQueryData get mediaQueryData => _mediaQueryData;
///每个逻辑像素的字体像素数,字体的缩放比例
static double get textScaleFactory => _textScaleFactor;
///设备的像素密度
static double get pixelRatio => _pixelRatio;
... ... @@ -71,4 +76,12 @@ class ScreenUtil {
/// 或者形状有差异时,高度适配建议使用此方法
/// 高度适配主要针对想根据设计稿的一屏展示一样的效果
setHeight(int height) => height * scaleHeight;
///字体大小适配方法
///@param fontSize 传入设计稿上字体的px ,
///@param allowFontScaling 控制字体是否要根据系统的“字体大小”辅助选项来进行缩放。默认值为true。
///@param allowFontScaling Specifies whether fonts should scale to respect Text Size accessibility settings. The default is true.
setSp(int fontSize, [allowFontScaling = true]) => allowFontScaling
? setWidth(fontSize) * _textScaleFactor
: setWidth(fontSize);
}
... ...
name: flutter_screenutil
description: A flutter plugin for screen adaptation
version: 0.2.3
description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version: 0.3.0
author: LiZhuoyuan <zhuoyuan93@gmail.com>
homepage: https://github.com/OpenFlutter/flutter_ScreenUtil
... ...