Skip to content

[Bug]: In the cCropRotateEditor, when the image is at the bottom, the top edge of the image is not covered by crop OverlayOpacity #776

@birdycn

Description

@birdycn

Package Version

12.0.2

Flutter Version

3.41

Platforms

Android

How to reproduce?

In the cCropRotateEditor, when the image is at the bottom, the top edge of the image is not covered by crop OverlayOpacity

As shown in the picture below, please note that there is a green line at the top, which is the topmost part of the image:
Image

my code:

Widget build(BuildContext context) {
    final l10n = context.l10n;
    return Theme(
      data: AppConfig.darkTheme,
      child: Builder(
        builder: (context) {
          final colorScheme = ColorScheme.of(context);

          final backgroundColor = colorScheme.surfaceContainerLowest;
          return Scaffold(
            backgroundColor: backgroundColor,
            body: CropRotateEditor.memory(
              key: _cropEditorKey,
              widget.imageBytes,
              initConfigs: CropRotateEditorInitConfigs(
                theme: AppConfig.darkTheme,

                configs: ProImageEditorConfigs(
                  heroTag: 'avatar',
                  designMode: platformDesignMode,
                  imageGeneration: const ImageGenerationConfigs(
                    outputFormat: .png,
                    pngFilter: .average,
                  ),
                  cropRotateEditor: CropRotateEditorConfigs(
                    tools: const [
                      CropRotateTool.rotate,
                      CropRotateTool.flip,
                      CropRotateTool.reset,
                    ],
                    initialCropMode: CropMode.oval,
                    initAspectRatio: 1,
                    desktopCornerDragArea: 0.00000001,
                    mobileCornerDragArea: 0.00000001,
                    style: CropRotateEditorStyle(
                      appBarBackground: Colors.transparent,
                      appBarColor: colorScheme.onSurface,
                      helperLineColor: colorScheme.onSurface,
                      background: backgroundColor,
                      cropCornerColor: colorScheme.onSurface,
                      cropOverlayColor: colorScheme.scrim,
                      bottomBarBackground: Colors.transparent,
                      bottomBarColor: colorScheme.onSurface,
                      cropCornerLength: 0,
                      cropCornerThickness: 0,
                      cropOverlayOpacity: 1,
                      cropOverlayInteractionOpacity: 0.45,
                    ),
                    widgets: CropRotateEditorWidgets(
                      appBar: (cropRotateEditor, rebuildStream) => null,
                      bottomBar: (cropRotateEditor, rebuildStream) =>
                          ReactiveWidget(
                            stream: rebuildStream,
                            builder: (_) => Padding(
                              padding: 4.paddingX,
                              child: Row(
                                mainAxisAlignment: .spaceBetween,
                                children: [
                                  TextButton(
                                    onPressed: () {
                                      context.router.pop();
                                    },
                                    child: Text(l10n.cancel),
                                  ),
                                  FilledButton(
                                    onPressed: () {},
                                    style: FilledButton.styleFrom(
                                      visualDensity: .compact,
                                      padding: .zero,
                                    ),
                                    child: Text(l10n.save),
                                  ),
                                ],
                              ),
                            ),
                          ),
                    ),
                  ),
                ),
              ),
            ),
          );
        },
      ),
    );
  }

Logs (optional)

Example code (optional)

Device Model (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions