Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing not working properly in Firefox #82

Open
FlorentineDraegerProtofy opened this issue Apr 19, 2024 · 1 comment
Open

Resizing not working properly in Firefox #82

FlorentineDraegerProtofy opened this issue Apr 19, 2024 · 1 comment

Comments

@FlorentineDraegerProtofy
Copy link

FlorentineDraegerProtofy commented Apr 19, 2024

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!

@deakjahn
Copy link
Owner

deakjahn commented Apr 19, 2024

There was a rather recent problem in Flutter involving Firefox, although, as far as I know, not specifically resizing, see #77. Could it be related by any chance? At any rate, I see that you're quite a few versions behind the current Flutter — 3.19.0 rather than 3.19.6 —, so you might want to try this first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants