diff --git a/lib/main.dart b/lib/main.dart index dbe215a..38098ef 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,7 @@ import 'package:event/event.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:nhentai/screens/components/mouse_and_touch_scroll_behavior.dart'; import 'package:nhentai/screens/init_screen.dart'; import 'basic/configs/themes.dart'; @@ -37,6 +38,7 @@ class MyAppState extends State { @override Widget build(BuildContext context) { return MaterialApp( + scrollBehavior: mouseAndTouchScrollBehavior, debugShowCheckedModeBanner: false, theme: currentThemeData(), darkTheme: currentDarkTheme(), diff --git a/lib/screens/comic_reader_screen.dart b/lib/screens/comic_reader_screen.dart index 2bbf758..10b8a90 100644 --- a/lib/screens/comic_reader_screen.dart +++ b/lib/screens/comic_reader_screen.dart @@ -10,7 +10,6 @@ import 'package:nhentai/basic/configs/reader_direction.dart'; import 'package:nhentai/basic/configs/reader_type.dart'; import 'package:nhentai/basic/configs/web_address.dart'; import 'package:nhentai/basic/entities/entities.dart'; -import 'package:nhentai/screens/components/content_loading.dart'; import 'package:nhentai/screens/components/images.dart'; import 'package:photo_view/photo_view_gallery.dart'; diff --git a/lib/screens/components/mouse_and_touch_scroll_behavior.dart b/lib/screens/components/mouse_and_touch_scroll_behavior.dart new file mode 100644 index 0000000..481226a --- /dev/null +++ b/lib/screens/components/mouse_and_touch_scroll_behavior.dart @@ -0,0 +1,12 @@ +import 'dart:ui'; +import 'package:flutter/material.dart'; + +final mouseAndTouchScrollBehavior = MouseAndTouchScrollBehavior(); + +class MouseAndTouchScrollBehavior extends MaterialScrollBehavior { + @override + Set get dragDevices => { + PointerDeviceKind.touch, + PointerDeviceKind.mouse, + }; +}