mouse touch scroll

This commit is contained in:
niuhuan 2022-01-18 14:01:01 +08:00
parent 0a95b951a6
commit 4911c5b11c
8 changed files with 20 additions and 6 deletions

View File

@ -1,7 +1,8 @@
import 'package:event/event.dart'; import 'package:event/event.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pikapika/screens/InitScreen.dart'; import 'package:pikapika/screens/InitScreen.dart';
import 'package:pikapika/basic/Navigatior.dart'; import 'package:pikapika/basic/Navigator.dart';
import 'package:pikapika/screens/components/MouseAndTouchScrollBehavior.dart';
import 'basic/config/Themes.dart'; import 'basic/config/Themes.dart';
@ -36,6 +37,7 @@ class _PikapikaAppState extends State<PikapikaApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
scrollBehavior: mouseAndTouchScrollBehavior,
theme: currentThemeData(), theme: currentThemeData(),
darkTheme: currentDarkTheme(), darkTheme: currentDarkTheme(),
navigatorObservers: [navigatorObserver, routeObserver], navigatorObservers: [navigatorObserver, routeObserver],

View File

@ -3,7 +3,7 @@ import 'package:pikapika/basic/Common.dart';
import 'package:pikapika/basic/Cross.dart'; import 'package:pikapika/basic/Cross.dart';
import 'package:pikapika/basic/Entities.dart'; import 'package:pikapika/basic/Entities.dart';
import 'package:pikapika/screens/ComicsScreen.dart'; import 'package:pikapika/screens/ComicsScreen.dart';
import 'package:pikapika/basic/Navigatior.dart'; import 'package:pikapika/basic/Navigator.dart';
import 'package:pikapika/screens/components/CommentMainType.dart'; import 'package:pikapika/screens/components/CommentMainType.dart';
import 'package:pikapika/screens/components/ItemBuilder.dart'; import 'package:pikapika/screens/components/ItemBuilder.dart';
import 'package:pikapika/basic/Method.dart'; import 'package:pikapika/basic/Method.dart';

View File

@ -2,7 +2,7 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pikapika/basic/Entities.dart'; import 'package:pikapika/basic/Entities.dart';
import 'package:pikapika/basic/Navigatior.dart'; import 'package:pikapika/basic/Navigator.dart';
import 'package:pikapika/basic/Method.dart'; import 'package:pikapika/basic/Method.dart';
import 'ComicInfoScreen.dart'; import 'ComicInfoScreen.dart';
import 'DownloadExportToFileScreen.dart'; import 'DownloadExportToFileScreen.dart';

View File

@ -4,7 +4,7 @@ import 'package:pikapika/basic/Cross.dart';
import 'package:pikapika/basic/Entities.dart'; import 'package:pikapika/basic/Entities.dart';
import 'package:pikapika/basic/Method.dart'; import 'package:pikapika/basic/Method.dart';
import 'package:pikapika/screens/SearchScreen.dart'; import 'package:pikapika/screens/SearchScreen.dart';
import 'package:pikapika/basic/Navigatior.dart'; import 'package:pikapika/basic/Navigator.dart';
import '../ComicsScreen.dart'; import '../ComicsScreen.dart';
import 'Images.dart'; import 'Images.dart';

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pikapika/screens/ComicsScreen.dart'; import 'package:pikapika/screens/ComicsScreen.dart';
import 'package:pikapika/basic/Navigatior.dart'; import 'package:pikapika/basic/Navigator.dart';
// tag // tag
class ComicTagsCard extends StatelessWidget { class ComicTagsCard extends StatelessWidget {

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pikapika/basic/Navigatior.dart'; import 'package:pikapika/basic/Navigator.dart';
import '../ComicInfoScreen.dart'; import '../ComicInfoScreen.dart';

View File

@ -0,0 +1,12 @@
import 'dart:ui';
import 'package:flutter/material.dart';
final mouseAndTouchScrollBehavior = MouseAndTouchScrollBehavior();
class MouseAndTouchScrollBehavior extends MaterialScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
};
}