Skip to content

Resizing not working properly in Firefox #82

@FlorentineDraegerProtofy

Description

We're using dropzone in our Flutter project and the resizing of our widget is not working properly in firefox. When removing the dropzoneview, resizing starts working. It works fine in chrome

  Widget build(BuildContext context) {
    final isHighlighted = ref.watch(importNotifierProvider).isImportBoxHighlighted;

    void handleDropFile(dynamic ev) async {
      final file = await controller.getFileData(ev);
      final droppedFile = await convertDroppedFile(file);
      final rootCompany = ref.read(rootCompanyProvider)!;
      await ref.read(importNotifierProvider.notifier).startImport(
            rootCompany.id,
            droppedFile,
          );
      ref.read(importNotifierProvider.notifier).startWatchingImportStatus();
    }

    return Stack(
      children: [
        Container(
          color: isHighlighted ? theme.colors.background.success : Colors.transparent,
          child: DropzoneView(
            operation: DragOperation.copy,
            cursor: CursorType.grab,
            onCreated: (DropzoneViewController ctrl) {
              controller = ctrl;
            },
            onDrop: handleDropFile,
            onHover: () {
              ref.read(importNotifierProvider.notifier).setImportBoxisHighlighted(true);
            },
            onLeave: () {
              ref.read(importNotifierProvider.notifier).setImportBoxisHighlighted(false);
            },
          ),
        ),
        GestureDetector(
          onTap: widget.onTap,
          child: MouseRegion(
            cursor: SystemMouseCursors.click,
            child: DottedBorder(
              dashPattern: const [8, 4],
              borderType: BorderType.RRect,
              color: Colors.black,
              strokeWidth: 1,
              radius: Radius.circular(theme.spacing.factor(1.5)),
              child: Padding(
                padding: const EdgeInsets.all(24.0),
                child: Column(
                    crossAxisAlignment: CrossAxisAlignment.stretch,
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Icon(
                        color: Colors.black,
                        Icons.file_upload_outlined,
                        size: theme.spacing.factor(4),
                      ),
                      const VerticalSpacer(2),
                      Center(
                        child: RichText(
                          textAlign: TextAlign.center,
                          text: TextSpan(
                            children: <TextSpan>[
                              TextSpan(
                                text:
                                    LocaleKeys.maintenance_emptyState_import_uploadButtonFirst.tr(),
                                style: theme.textTheme.bodyMedium!.copyWith(
                                  color: theme.colors.text.primary,
                                  fontWeight: FontWeight.w500,
                                ),
                              ),
                              const TextSpan(text: ' '),
                              TextSpan(
                                text: LocaleKeys.uploadButtonSecond
                                    .tr(),
                                style: theme.textTheme.bodyMedium!.copyWith(
                                  color: theme.colors.text.secondary,
                                ),
                              ),
                            ],
                          ),
                        ),
                      )
                    ]),
              ),
            ),
          ),
        ),
      ],
    );
  }
}

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.0, on macOS 14.3.1 23D60 darwin-arm64, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] Android Studio (version 2022.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2.3)
[✓] VS Code (version 1.88.1)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for Florentine’s iPhone. Ensure the device is unlocked and attached with a
cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions