Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_screenutil
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李卓原
2020-12-16 19:37:53 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8af233dc5cd4e704826a3e2578a2be322df0455a
8af233dc
1 parent
c88f48c5
beta3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
107 additions
and
110 deletions
example/android/app/src/debug/AndroidManifest.xml
example/android/app/src/main/AndroidManifest.xml
example/android/app/src/main/kotlin/li/zhuoyuan/example/MainActivity.kt
example/android/app/src/main/res/drawable/launch_background.xml
example/android/app/src/profile/AndroidManifest.xml
example/ios/Flutter/flutter_export_environment.sh
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
lib/screenutil.dart
lib/screenutil_init.dart
example/android/app/src/debug/AndroidManifest.xml
View file @
8af233d
...
...
@@ -3,5 +3,5 @@
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
</manifest>
...
...
example/android/app/src/main/AndroidManifest.xml
View file @
8af233d
...
...
@@ -21,21 +21,19 @@
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name=
"io.flutter.embedding.android.NormalTheme"
android:resource=
"@style/NormalTheme"
/>
android:name=
"io.flutter.embedding.android.NormalTheme"
android:resource=
"@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name=
"io.flutter.embedding.android.SplashScreenDrawable"
android:resource=
"@drawable/launch_background"
/>
android:name=
"io.flutter.embedding.android.SplashScreenDrawable"
android:resource=
"@drawable/launch_background"
/>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
...
...
example/android/app/src/main/kotlin/li/zhuoyuan/example/MainActivity.kt
View file @
8af233d
...
...
@@ -2,5 +2,5 @@ package li.zhuoyuan.example
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
class MainActivity
: FlutterActivity() {
}
...
...
example/android/app/src/main/res/drawable/launch_background.xml
View file @
8af233d
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:drawable=
"@android:color/white"
/>
...
...
example/android/app/src/profile/AndroidManifest.xml
View file @
8af233d
...
...
@@ -3,5 +3,5 @@
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
</manifest>
...
...
example/ios/Flutter/flutter_export_environment.sh
View file @
8af233d
...
...
@@ -6,10 +6,10 @@ export "FLUTTER_TARGET=lib/main.dart"
export
"FLUTTER_BUILD_DIR=build"
export
"SYMROOT=
${
SOURCE_ROOT
}
/../build/ios"
export
"OTHER_LDFLAGS=
$(
inherited
)
-framework Flutter"
export
"FLUTTER_FRAMEWORK_DIR=/Users/lizhuoyuan/Development/flutter/bin/cache/artifacts/engine/ios
-release
"
export
"FLUTTER_FRAMEWORK_DIR=/Users/lizhuoyuan/Development/flutter/bin/cache/artifacts/engine/ios"
export
"FLUTTER_BUILD_NAME=1.0.0"
export
"FLUTTER_BUILD_NUMBER=1"
export
"DART_OBFUSCATION=false"
export
"TRACK_WIDGET_CREATION=false"
export
"TREE_SHAKE_ICONS=
tru
e"
export
"TREE_SHAKE_ICONS=
fals
e"
export
"PACKAGE_CONFIG=.packages"
...
...
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
View file @
8af233d
{
"images"
:
[
"images"
:
[
{
"size"
:
"20x20"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-20x20@2x.png"
,
"scale"
:
"2x"
"size"
:
"20x20"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-20x20@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"20x20"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-20x20@3x.png"
,
"scale"
:
"3x"
"size"
:
"20x20"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-20x20@3x.png"
,
"scale"
:
"3x"
},
{
"size"
:
"29x29"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-29x29@1x.png"
,
"scale"
:
"1x"
"size"
:
"29x29"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-29x29@1x.png"
,
"scale"
:
"1x"
},
{
"size"
:
"29x29"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-29x29@2x.png"
,
"scale"
:
"2x"
"size"
:
"29x29"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-29x29@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"29x29"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-29x29@3x.png"
,
"scale"
:
"3x"
"size"
:
"29x29"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-29x29@3x.png"
,
"scale"
:
"3x"
},
{
"size"
:
"40x40"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-40x40@2x.png"
,
"scale"
:
"2x"
"size"
:
"40x40"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-40x40@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"40x40"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-40x40@3x.png"
,
"scale"
:
"3x"
"size"
:
"40x40"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-40x40@3x.png"
,
"scale"
:
"3x"
},
{
"size"
:
"60x60"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-60x60@2x.png"
,
"scale"
:
"2x"
"size"
:
"60x60"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-60x60@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"60x60"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-60x60@3x.png"
,
"scale"
:
"3x"
"size"
:
"60x60"
,
"idiom"
:
"iphone"
,
"filename"
:
"Icon-App-60x60@3x.png"
,
"scale"
:
"3x"
},
{
"size"
:
"20x20"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-20x20@1x.png"
,
"scale"
:
"1x"
"size"
:
"20x20"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-20x20@1x.png"
,
"scale"
:
"1x"
},
{
"size"
:
"20x20"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-20x20@2x.png"
,
"scale"
:
"2x"
"size"
:
"20x20"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-20x20@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"29x29"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-29x29@1x.png"
,
"scale"
:
"1x"
"size"
:
"29x29"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-29x29@1x.png"
,
"scale"
:
"1x"
},
{
"size"
:
"29x29"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-29x29@2x.png"
,
"scale"
:
"2x"
"size"
:
"29x29"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-29x29@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"40x40"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-40x40@1x.png"
,
"scale"
:
"1x"
"size"
:
"40x40"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-40x40@1x.png"
,
"scale"
:
"1x"
},
{
"size"
:
"40x40"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-40x40@2x.png"
,
"scale"
:
"2x"
"size"
:
"40x40"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-40x40@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"76x76"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-76x76@1x.png"
,
"scale"
:
"1x"
"size"
:
"76x76"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-76x76@1x.png"
,
"scale"
:
"1x"
},
{
"size"
:
"76x76"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-76x76@2x.png"
,
"scale"
:
"2x"
"size"
:
"76x76"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-76x76@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"83.5x83.5"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-83.5x83.5@2x.png"
,
"scale"
:
"2x"
"size"
:
"83.5x83.5"
,
"idiom"
:
"ipad"
,
"filename"
:
"Icon-App-83.5x83.5@2x.png"
,
"scale"
:
"2x"
},
{
"size"
:
"1024x1024"
,
"idiom"
:
"ios-marketing"
,
"filename"
:
"Icon-App-1024x1024@1x.png"
,
"scale"
:
"1x"
"size"
:
"1024x1024"
,
"idiom"
:
"ios-marketing"
,
"filename"
:
"Icon-App-1024x1024@1x.png"
,
"scale"
:
"1x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
...
...
example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
View file @
8af233d
{
"images"
:
[
"images"
:
[
{
"idiom"
:
"universal"
,
"filename"
:
"LaunchImage.png"
,
"scale"
:
"1x"
"idiom"
:
"universal"
,
"filename"
:
"LaunchImage.png"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"LaunchImage@2x.png"
,
"scale"
:
"2x"
"idiom"
:
"universal"
,
"filename"
:
"LaunchImage@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"LaunchImage@3x.png"
,
"scale"
:
"3x"
"idiom"
:
"universal"
,
"filename"
:
"LaunchImage@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
...
...
lib/screenutil.dart
View file @
8af233d
...
...
@@ -7,8 +7,8 @@ import 'package:flutter/material.dart';
import
'dart:ui'
as
ui
;
class
ScreenUtil
{
static
ScreenUtil
_instance
;
static
const
Size
defaultSize
=
Size
(
1080
,
1920
);
static
ScreenUtil
_instance
;
/// UI设计中手机尺寸 , px
/// Size of the phone in UI Design , px
...
...
lib/screenutil_init.dart
View file @
8af233d
...
...
@@ -4,7 +4,7 @@ import 'screenutil.dart';
class
ScreenUtilInit
extends
StatelessWidget
{
/// A helper widget that initializes [ScreenUtil]
const
ScreenUtilInit
({
ScreenUtilInit
({
@required
this
.
child
,
this
.
designSize
=
ScreenUtil
.
defaultSize
,
this
.
allowFontScaling
=
false
,
...
...
Please
register
or
login
to post a comment