사용자가 앱 내에서 직접 이미지를 수정할 수 있도록 허용하는 완전히 사용자 정의 가능하고 편집 가능한 이미지 위젯을 생성할 수 있는 플러터 패키지입니다. 자르기, 크기 조정 및 위치 지정과 같은 상호작용 기능을 지원하여 프로필 사진, 아바타 및 채팅 헤드에 적합합니다. 안드로이드, iOS 및 맥OS 플랫폼에서 원활한 통합을 위해 설계되었으며, 개발자가 UI 디자인과 사용자 인터랙션에서 유연성을 확보할 수 있도록 합니다. 깔끔한 API와 반응형 동작을 통해 동적 이미지 조작이 필요한 앱의 사용자 경험을 향상시킵니다.
사용 사례
프로필 사진 편집
아바타 사용자 정의
채팅 헤드 이미지 수정
사용자 생성 콘텐츠 제작
인터랙티브 이미지 오버레이
주요 기능
사용자 지정 가능한 이미지 편집
크로스 플랫폼 지원 (Android, iOS, macOS)
인터랙티브 자르기 및 크기 조정
반응형 UI 컴포넌트
기존 Flutter 앱과의 간편한 통합
적합한 대상
소셜 미디어 앱
사용자 프로필 관리
메시징 애플리케이션
사진 편집 도구
사용자 지정 UI 컴포넌트
고려 사항
이미지 해상도를 신중하게 다뤄야 합니다
큰 이미지와 함께 성능에 영향을 미칠 수 있습니다
기본 편집 기능에 제한됨
고급 사진 편집에 적합하지 않습니다
플랫폼 고유의 렌더링 동작에 의존합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Editable Image | Flutter Package
Flutter package for creating a fully customizable and editable image widget. The package has been written solely in Dart Language.
Features
A powerful and fully customizable widget. It provides a custom widget to save time.
For example, almost in every profile settings interface, etc., there is a profile image. Instead of writing from scratch, this widget can be used and can save a lot of time.
Getting started
Let's take a look at how to implement EditableImage to fastly create user interfaces for profile picture edit, etc.
Please upgrade the Kotlin version (ext.kotlin_version) to 1.7.0 or the latest version. To do that, find the following line inside android/build.gradle and modify it:
ext.kotlin_version = '1.7.0'
Please upgrade the Gradle version (ext.kotlin_version) to 6.8.3 or the latest version but lower than 7.0.0. To do that, find the following line inside android/gradle/wrapper/gradle-wrapper.properties and modify it:
I recommand you add android:requestLegacyExternalStorage="true" to AndroidManifest.xml. Therefore, please modify android/app/src/main/AndroidManifest.xml and add the following line inside application:
If you found some warning logs with Glide appearing, then the main project needs an implementation of AppGlideModule. See Generated API.
iOS Setup
Platform version must be at least 9.0. Please modify ios/Podfile and update accordingly:
platform :ios, '11.0'
Add the following lines to ios/Runner/Info.plist:
<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict><key>NSPhotoLibraryUsageDescription</key><string>Put here your permission description.</string>
macOS Setup
Platform version must be at least 10.15. Please modify macos/Podfile and update accordingly:
platform :osx, '10.15'
Please set the minimum deployment target to 10.15. Use XCode to open macos/Runner.xcworkspace:
Follow the iOS instructions and modify ios/Runner/Info.plist accordingly.
Usage
Basic usage example:
main.dart
// A simple usage of EditableImage.// This method gets called when trying to change an image.void_directUpdateImage(File? file) async {
if (file == null) return;
setState(() {
_profilePicFile = file;
});
}
EditableImage(
// Define the method that will run on the change process of the image.
onChange: (file) => _directUpdateImage(file),
// Define the source of the image.
image: _profilePicFile != null
? Image.file(_profilePicFile!, fit: BoxFit.cover)
: null,
// Define the size of EditableImage.
size: 150.0,
// Define the Theme of image picker.
imagePickerTheme: ThemeData(
// Define the default brightness and colors.
primaryColor: Colors.white,
shadowColor: Colors.transparent,
backgroundColor: Colors.white70,
iconTheme: constIconThemeData(color: Colors.black87),
// Define the default font family.
fontFamily: 'Georgia',
),
// Define the border of the image if needed.
imageBorder: Border.all(color: Colors.black87, width: 2.0),
// Define the border of the icon if needed.
editIconBorder: Border.all(color: Colors.black87, width: 2.0),
),
Example
More examples can be found in /example folder on GitHub.
User Profile 1 - an example of basic implementation of EditableImage. Simple project that simulates user profile edit screen.
User Profile 2 - an example of implementation of EditableImage. Simple project that simulates user profile edit screen.
Additional information
This package has been written solely in Dart Language yet it has the wechat_assets_picker as a dependency. Therefore, EditableImage currently supports only Android, iOS, and macOS platforms. In the future, other platform supports may be added.