flutter_image_cropper icon indicating copy to clipboard operation
flutter_image_cropper copied to clipboard

The status bar blocks the tool operation bar

Open MisterZhu opened this issue 7 months ago • 6 comments

Image shown below code giving above output

final croppedFile = await ImageCropper().cropImage(
      sourcePath: widget.imageFile.path,
      aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1),
      compressFormat: ImageCompressFormat.jpg,
      compressQuality: 100,
      uiSettings: [
        AndroidUiSettings(
          toolbarTitle: '裁剪图片'.tr,
          toolbarColor: Colors.white,
          initAspectRatio: CropAspectRatioPreset.original,
          lockAspectRatio: true,
        ),
        IOSUiSettings(
          title: '裁剪图片'.tr,
        ),
      ],
    );

Mobile phone brand: OnePlus Ace 2 Pro Android System 15

MisterZhu avatar Jun 06 '25 01:06 MisterZhu

I have the same issue on Google Pixel 9 Pro XL

irchriscott avatar Jun 10 '25 12:06 irchriscott

Image

same issue

VivekSorathiyaa avatar Jun 10 '25 12:06 VivekSorathiyaa

Same issue but with System navigation bar: it blocks the crop, zoom, retake actions on Pixel 4 emulator – 1080 × 2280 And can be reproduced on other production devices

Image

AsmaaAlamrawy avatar Jun 11 '25 11:06 AsmaaAlamrawy

Screenshot_20250615-215857.png

Same issue here with all android phones targeting Android 35 and above It's a SafeArea issue

Belveloper avatar Jun 15 '25 21:06 Belveloper

same :)

antiv avatar Jun 16 '25 11:06 antiv

@hnvn Hi 👋 Thanks a lot for your amazing work on the image_cropper package it's been super helpful

I just wanted to flag a small issue: on Android 14/15+ (SDK 34/35), the status bar now overlaps the tool operation bar, making cropping a bit tricky for users. Could you please consider updating the layout to better support the new Android system UI behavior?

Belveloper avatar Jun 16 '25 17:06 Belveloper

I have solved, please see change log 9.0.0 and 8.1.0, needs to be modified or new android/app/SRC/main/res/configuration file @antiv @Belveloper @AsmaaAlamrawy @VivekSorathiyaa @irchriscott

MisterZhu avatar Jun 19 '25 06:06 MisterZhu

Image The problem was solved by checking the 9.0.0 Changelog

MisterZhu avatar Jun 19 '25 06:06 MisterZhu

I have all the settings correspond to the Readme section. But the problem is still relevant. Pixel 9 Flutter 3.35.1, Dart 3.9.0

TicTac705 avatar Aug 27 '25 10:08 TicTac705

@TicTac705 had the same issue. Changing res/values-v35/styles.xml to the following seems to have fixed it:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Ucrop.CropTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
        <item name="android:statusBarColor">@android:color/black</item>
        <item name="android:windowLightStatusBar">false</item>
        <item name="android:fitsSystemWindows">true</item>
    </style>
</resources>

The status bar is completely white, but only while the cropper view is active so w/e.

msuddaby avatar Sep 12 '25 16:09 msuddaby