Skip to content

Commit

Permalink
mouse touch scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Jan 18, 2022
1 parent 0a95b95 commit 4911c5b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
File renamed without changes.
4 changes: 3 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'package:event/event.dart';
import 'package:flutter/material.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';

Expand Down Expand Up @@ -36,6 +37,7 @@ class _PikapikaAppState extends State<PikapikaApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
scrollBehavior: mouseAndTouchScrollBehavior,
theme: currentThemeData(),
darkTheme: currentDarkTheme(),
navigatorObservers: [navigatorObserver, routeObserver],
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/ComicInfoScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:pikapika/basic/Common.dart';
import 'package:pikapika/basic/Cross.dart';
import 'package:pikapika/basic/Entities.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/ItemBuilder.dart';
import 'package:pikapika/basic/Method.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/DownloadInfoScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:convert';

import 'package:flutter/material.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 'ComicInfoScreen.dart';
import 'DownloadExportToFileScreen.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/components/ComicInfoCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:pikapika/basic/Cross.dart';
import 'package:pikapika/basic/Entities.dart';
import 'package:pikapika/basic/Method.dart';
import 'package:pikapika/screens/SearchScreen.dart';
import 'package:pikapika/basic/Navigatior.dart';
import 'package:pikapika/basic/Navigator.dart';
import '../ComicsScreen.dart';
import 'Images.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/screens/components/ComicTagsCard.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:pikapika/screens/ComicsScreen.dart';
import 'package:pikapika/basic/Navigatior.dart';
import 'package:pikapika/basic/Navigator.dart';

// 漫画tag
class ComicTagsCard extends StatelessWidget {
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/components/LinkToComicInfo.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:pikapika/basic/Navigatior.dart';
import 'package:pikapika/basic/Navigator.dart';

import '../ComicInfoScreen.dart';

Expand Down
12 changes: 12 additions & 0 deletions lib/screens/components/MouseAndTouchScrollBehavior.dart
Original file line number Diff line number Diff line change
@@ -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,
};
}

0 comments on commit 4911c5b

Please sign in to comment.