Skip to content

Commit 67cce5c

Browse files
committed
page view gesture
1 parent 99dd9d5 commit 67cce5c

File tree

4 files changed

+37
-25
lines changed

4 files changed

+37
-25
lines changed

lib/page/picture/illust_lighting_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import 'dart:io';
1919
import 'package:bot_toast/bot_toast.dart';
2020
import 'package:easy_refresh/easy_refresh.dart';
2121
import 'package:flutter/cupertino.dart';
22+
import 'package:flutter/gestures.dart';
2223
import 'package:flutter/material.dart';
2324
import 'package:flutter/services.dart';
2425
import 'package:flutter_mobx/flutter_mobx.dart';

lib/page/picture/picture_list_page.dart

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*
1515
*/
1616

17+
import 'package:flutter/gestures.dart';
1718
import 'package:flutter/material.dart';
1819
import 'package:flutter_mobx/flutter_mobx.dart';
1920
import 'package:pixez/lighting/lighting_store.dart';
@@ -67,29 +68,38 @@ class _PictureListPageState extends State<PictureListPage> {
6768
Widget build(BuildContext context) {
6869
screenWidth = MediaQuery.of(context).size.width / 2;
6970
return Observer(builder: (_) {
70-
return PageView.builder(
71-
controller: _pageController,
72-
physics: userSetting.swipeChangeArtwork
73-
? null
74-
: NeverScrollableScrollPhysics(),
75-
itemBuilder: (BuildContext context, int index) {
76-
if (index == _iStores.length && _lightingStore != null) {
77-
return PictureListNextPage(
78-
lightingStore: _lightingStore!,
71+
return MediaQuery(
72+
data: MediaQuery.of(context)
73+
.copyWith(gestureSettings: DeviceGestureSettings(touchSlop: 50)),
74+
child: PageView.builder(
75+
controller: _pageController,
76+
physics: userSetting.swipeChangeArtwork
77+
? null
78+
: NeverScrollableScrollPhysics(),
79+
itemBuilder: (BuildContext context, int index) {
80+
if (index == _iStores.length && _lightingStore != null) {
81+
return PictureListNextPage(
82+
lightingStore: _lightingStore!,
83+
);
84+
}
85+
final f = _iStores[index];
86+
String? tag = nowPosition == index ? widget.heroString : null;
87+
return MediaQuery(
88+
data: MediaQuery.of(context).copyWith(
89+
gestureSettings:
90+
DeviceGestureSettings(touchSlop: kTouchSlop)),
91+
child: IllustLightingPage(
92+
id: f.id,
93+
heroString: tag,
94+
store: f,
95+
onHorizontalDragEnd: (details) {
96+
_onDrag(details);
97+
},
98+
),
7999
);
80-
}
81-
final f = _iStores[index];
82-
String? tag = nowPosition == index ? widget.heroString : null;
83-
return IllustLightingPage(
84-
id: f.id,
85-
heroString: tag,
86-
store: f,
87-
onHorizontalDragEnd: (details) {
88-
_onDrag(details);
89-
},
90-
);
91-
},
92-
itemCount: _iStores.length + 1,
100+
},
101+
itemCount: _iStores.length + 1,
102+
),
93103
);
94104
});
95105
}

macos/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@
555555
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
556556
GCC_WARN_UNUSED_FUNCTION = YES;
557557
GCC_WARN_UNUSED_VARIABLE = YES;
558-
MACOSX_DEPLOYMENT_TARGET = 10.14;
558+
MACOSX_DEPLOYMENT_TARGET = 10.15;
559559
MTL_ENABLE_DEBUG_INFO = NO;
560560
SDKROOT = macosx;
561561
SWIFT_COMPILATION_MODE = wholemodule;
@@ -638,7 +638,7 @@
638638
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
639639
GCC_WARN_UNUSED_FUNCTION = YES;
640640
GCC_WARN_UNUSED_VARIABLE = YES;
641-
MACOSX_DEPLOYMENT_TARGET = 10.14;
641+
MACOSX_DEPLOYMENT_TARGET = 10.15;
642642
MTL_ENABLE_DEBUG_INFO = YES;
643643
ONLY_ACTIVE_ARCH = YES;
644644
SDKROOT = macosx;
@@ -685,7 +685,7 @@
685685
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
686686
GCC_WARN_UNUSED_FUNCTION = YES;
687687
GCC_WARN_UNUSED_VARIABLE = YES;
688-
MACOSX_DEPLOYMENT_TARGET = 10.14;
688+
MACOSX_DEPLOYMENT_TARGET = 10.15;
689689
MTL_ENABLE_DEBUG_INFO = NO;
690690
SDKROOT = macosx;
691691
SWIFT_COMPILATION_MODE = wholemodule;

macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
ignoresPersistentStateOnLaunch = "NO"
6060
debugDocumentVersioning = "YES"
6161
debugServiceExtension = "internal"
62+
enableGPUValidationMode = "1"
6263
allowLocationSimulation = "YES">
6364
<BuildableProductRunnable
6465
runnableDebuggingMode = "0">

0 commit comments

Comments
 (0)