설치
플러그인을 설치합니다.
flutter pub add flutter_native_splash
pubspec.yaml 에 옵션 추가
아래와 같이 pubspec.yaml 파일에 옵션을 추가하세요. 모든 옵션은 여기서 확인해 주세요.
주의
안드로이드 12 이상 운영체제를 탑재한 기기는 이미지가 클립화 되어 이상하게 출력될 수 있습니다. 이미지 크기를 조정해 주세요.
flutter_native_splash:
color: "#ffffff"
image: image/logo.png
android: true
android_12:
image: image/logo.png
ios: true
적용
아래 명령어를 통해 splash screen 옵션을 적용해 주세요. 옵션이 바뀔 때마다 적용이 필요합니다.
dart run flutter_native_splash:create
참고 : android 12+ 이미지가 계속 짤릴 때
1152px * 1152px 파일 정중앙에 525px * 525px 정사각형 내 이미지가 삽입된 파일을 적용해 보세요.
참고 : 빌드 클린
flutter clean
flutter pub get
참고 자료
'프로그래밍 > Flutter <Dart>' 카테고리의 다른 글
[Flutter] 플러터 앱 성능 측정 및 평가, 성능을 개선하는 방법 with Android Studio (3) | 2024.11.11 |
---|---|
[Flutter] Android Studio LadyBug Unsupported class file major version 65 빌드 에러 해결 (0) | 2024.11.10 |
[Flutter] Futurebuilder Future ListView 템플릿 (0) | 2024.09.28 |
[Flutter] Deprecated imperative apply of Flutter's Gradle plugins (2) | 2024.09.25 |
[Flutter] Futurebuilder Future 객체 리로드 중일 때의 상태 표현하기 (2) | 2024.09.22 |