You are currently viewing Flutter闪屏启动插件flutter_native_splash使用方法

Flutter闪屏启动插件flutter_native_splash使用方法

當前文章的短網址連結為: https://unos.top/qw37

Flutter Pub

https://pub.dev/packages/flutter_native_splash/

How to use

1.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
dependencies:
flutter_native_splash: ^0.1.9
dependencies: flutter_native_splash: ^0.1.9
dependencies:
  flutter_native_splash: ^0.1.9

2. Execute the command line below

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
pub get
or
flutter pub get
pub get or flutter pub get
pub get 

or 

flutter pub get 

3. Config in your pubspec.yaml , add below codes

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
flutter_native_splash:
image: assets/images/splash.png #// 对应生成iOS中LaunchImage图片,包含1x2x3x
color: "#FFFFFF" # 闪屏页背景色
android: true # 是否支持android
android_disable_fullscreen: false #是否禁用android全屏启动
fill: true #如果图像可用在所有的屏幕上添加为true,目前支持android
flutter_native_splash: image: assets/images/splash.png #// 对应生成iOS中LaunchImage图片,包含1x2x3x color: "#FFFFFF" # 闪屏页背景色 android: true # 是否支持android android_disable_fullscreen: false #是否禁用android全屏启动 fill: true #如果图像可用在所有的屏幕上添加为true,目前支持android
flutter_native_splash:
  image: assets/images/splash.png #// 对应生成iOS中LaunchImage图片,包含1x2x3x
  color: "#FFFFFF"  # 闪屏页背景色
  android: true # 是否支持android
  android_disable_fullscreen: false #是否禁用android全屏启动
  fill: true #如果图像可用在所有的屏幕上添加为true,目前支持android

4. Generate android or IOS project resources.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
flutter pub pub run flutter_native_splash:create
flutter pub pub run flutter_native_splash:create
flutter pub pub run flutter_native_splash:create
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
app>flutter pub pub run flutter_native_splash:create
[Android] Creating splash images
[Android] Updating launch_background.xml with splash image path
[Android] No colors.xml file found in your Android project
[Android] Creating colors.xml file and adding it to your Android project
[Android] Updating styles.xml with full screen mode setting
[iOS] Creating splash images
[iOS] Updating LaunchScreen.storyboard with width, height and color
[iOS] Updating Info.plist for status bar hidden/visible
[iOS] Updating AppDelegate for status bar hidden/visible
app>flutter pub pub run flutter_native_splash:create [Android] Creating splash images [Android] Updating launch_background.xml with splash image path [Android] No colors.xml file found in your Android project [Android] Creating colors.xml file and adding it to your Android project [Android] Updating styles.xml with full screen mode setting [iOS] Creating splash images [iOS] Updating LaunchScreen.storyboard with width, height and color [iOS] Updating Info.plist for status bar hidden/visible [iOS] Updating AppDelegate for status bar hidden/visible
app>flutter pub pub run flutter_native_splash:create
[Android] Creating splash images
[Android] Updating launch_background.xml with splash image path
[Android] No colors.xml file found in your Android project
[Android] Creating colors.xml file and adding it to your Android project
[Android] Updating styles.xml with full screen mode setting
[iOS] Creating splash images
[iOS] Updating LaunchScreen.storyboard with width, height and color
[iOS] Updating Info.plist for status bar hidden/visible
[iOS] Updating AppDelegate for status bar hidden/visible

5. Import namespace in your dart code

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
0 0 投票数
文章评分
订阅评论
提醒
guest


这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

0 评论
最旧
最新 最多投票
内联反馈
查看所有评论