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

Scroll Not Working using TouchPad or TrackPad #2511

Open
2 tasks done
VeerneToor opened this issue Jan 22, 2025 · 0 comments
Open
2 tasks done

Scroll Not Working using TouchPad or TrackPad #2511

VeerneToor opened this issue Jan 22, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@VeerneToor
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When scrolling vertically by means of a touchpad it does not work correctly, in fact. It is impossible to use.

Expected Behavior

El scroll vertical y el horizontal deberial funcionar con normalidad y percibir todos los cambios del scroll en cualquier tipo de movimiento, "rapido" o "lento"

Steps with code example to reproduce

Steps with code example to reproduce
import 'dart:async';
import 'dart:io';

import 'package:ScalboostBrowser/main.dart';
import 'package:ScalboostBrowser/types/browser_types.dart';
import 'package:ScalboostBrowser/types/controllers/downloads.interface.dart';
import 'package:ScalboostBrowser/utils/custom_gesture_recognizer.dart';
import 'package:ScalboostBrowser/utils/utils.dart';
import 'package:ScalboostBrowser/views/components/downloads_popup.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:ScalboostBrowser/types/controllers/browser_history.interface.dart';
import 'package:ScalboostBrowser/types/controllers/profiles.interface.dart';
import 'package:ScalboostBrowser/types/controllers/tabs.interface.dart';
import 'package:ScalboostBrowser/views/screens/browser/components/browser_home.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:webview_windows/webview_windows.dart';

class BrowserWebViewManager extends StatefulWidget {
  const BrowserWebViewManager({super.key});

  @override
  State<BrowserWebViewManager> createState() => _BrowserWebViewManagerState();
}

class _BrowserWebViewManagerState extends State<BrowserWebViewManager> {
  final tabsController = Get.find<ITabsController>();
  final browserHistoryController = Get.find<IBrowserHistoryController>();
  final profilesController = Get.find<IProfilesController>();
  bool isLoading = false;

  @override
  void initState() {
    super.initState();
    
    ...
  }

  @override
  void dispose() {
    ...
  }

  List<Map<String, String>> getCredentials() {
    ...
    return credentials;
  }

  InAppWebViewSettings settings = InAppWebViewSettings(
    isInspectable: kDebugMode,
    mediaPlaybackRequiresUserGesture: false,
    useOnDownloadStart: true,
    allowsInlineMediaPlayback: true,
    transparentBackground: true,
    scrollMultiplier: Platform.isWindows ? 200 : 1,
    useOnLoadResource: true,
    useShouldOverrideUrlLoading: true,
    javaScriptEnabled: true,
    cacheEnabled: true,
    allowUniversalAccessFromFileURLs: true,
    allowFileAccessFromFileURLs: true,
    disableDefaultErrorPage: true,
    overScrollMode: OverScrollMode.NEVER,
    scrollBarFadeDuration: 100,
    scrollBarDefaultDelayBeforeFade: 300,
    decelerationRate: ScrollViewDecelerationRate.FAST,
    applicationNameForUserAgent: 'Version/16.0 Safari/605.1.15',
    userAgent:
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15',
    verticalScrollbarTrackColor: Colors.transparent,
    horizontalScrollbarTrackColor: Colors.transparent,
    verticalScrollBarEnabled: true,
    horizontalScrollBarEnabled: false,
    disableVerticalScroll: false,
    disableHorizontalScroll: true,
    verticalScrollbarThumbColor: Colors.transparent,
    horizontalScrollbarThumbColor: Colors.transparent,
  );

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(top: 10.h),
      child: Obx(() {
        final activeIndex =
            tabsController.tabs.indexWhere((tab) => tab.isSelected);

        return IndexedStack(
          sizing: StackFit.expand,
          index: activeIndex < 0 ? 0 : activeIndex,
          children: tabsController.tabs.map((tab) {
            if (!tab.isVisible) return const SizedBox.shrink();
            if (tab.url.startsWith("browser://")) {
              return BrowserHome();
            }

            try {
              return SizedBox(
                width: double.infinity,
                child: ClipRRect(
                  key: ValueKey('webview-${tab.id}'),
                  borderRadius: BorderRadius.circular(15),
                  child: Builder(builder: (context) {
                    return InAppWebView(
                      webViewEnvironment: webViewEnvironment,
                      key: ValueKey(tab.id),
                      windowId: tab.id.hashCode,
                      initialSettings: settings,
                      onDownloadStarting: onDownloadStartRequest,
                      onLoadStart: (controller, url) async {
                       ...
                      },
                      shouldOverrideUrlLoading: (_, navigationAction) async {
                       ...
                      },
                      onReceivedError: (controller, request, error) {
                        ...
                      },
                      onPermissionRequest: (controller, request) async {
                        ...
                      },
                      onWebViewCreated: (controller) async {
                        ...
                      },
                      onLoadStop: (controller, url) async {
                        ...
                      },
                      onWindowFocus: (controller) async {
                        ...
                      },
                      onWindowBlur: (controller) {
                        ...
                      },
                      onProgressChanged: (controller, progress) async {
                        ...
                      },
                    );
                  }),
                ),
              );
            } catch (e) {
              return Text(e.toString());
            }
          }).toList(),
        );
      }),
    );
  }
}

Stacktrace/Logs

Stacktrace/Logs
No logs

Flutter version

v3.5.3

Operating System, Device-specific and/or Tool

Windows 11

Laptop with TouchPad
16GB RAM
1T SSD
FHD (1080x720)

Plugin version

v6.0.0 - betaVersions

Additional information

This incident really generates problems in my operation, the base of my project is this library, if someone could help me even telling me where I can look for it I would be very grateful.

Self grab

  • I'm ready to work on this issue!
@VeerneToor VeerneToor added the bug Something isn't working label Jan 22, 2025
@VeerneToor VeerneToor changed the title Scroll Not Wirking using TouchPad or TrakPad Scroll Not Working using TouchPad or TrackPad Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant