1.首先在pubspec.yaml文件中新增依赖pub.dev
image_picker: ^0.8.7+5
image_cropper: ^4.0.1
2.在Android的AndroidManifest.xml文件里面添加权限
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
3.在ios的Info.plist文件里面添加权限 项目根目录
<key>NSCameraUsageDescription</key>
<string>这是你的自拍照</string>
<key>NSMicrophoneUsageDescription</key>
<string>用于音频插件</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>用于相册选择插件</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>