chore: upgrade minimum support flutter version, >= 3.3.0 (#1551)

* feat: upgrade flutter version to 3.3.0 for appflowy_editor and appflowy_editor_plugin

* feat: upgrade flutter version to 3.3.0 for appflowy

* feat: upgrade flutter version to 3.3.0 for CI

* chore: update flutter version in ci workflows

* chore: fix warnings

* chore: fix unuse import

* chore: support  cargo make dart_unit_test on windows platform

* fix: copy to sandbox errors

Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
Lucas.Xu 2023-01-01 23:26:27 +08:00 • committed by GitHub
commit 7b883e56f4
5 changed files with 22 additions and 7 deletions

View file

@ -68,7 +68,7 @@ class _AppFlowyInputState extends State<AppFlowyInput>
final Map<ShortcutActivator, Intent> _shortcuts = kIsWeb
? {
LogicalKeySet(LogicalKeyboardKey.space):
DoNothingAndStopPropagationIntent(),
const DoNothingAndStopPropagationIntent(),
}
: {};

View file

@ -92,6 +92,7 @@ class _AppFlowyScrollState extends State<AppFlowyScroll>
Widget build(BuildContext context) {
return Listener(
onPointerSignal: _onPointerSignal,
onPointerPanZoomUpdate: _onPointerPanZoomUpdate,
child: CustomScrollView(
key: _scrollViewKey,
physics: const NeverScrollableScrollPhysics(),
@ -134,4 +135,11 @@ class _AppFlowyScrollState extends State<AppFlowyScroll>
scrollTo(dy);
}
}
void _onPointerPanZoomUpdate(PointerPanZoomUpdateEvent event) {
if (_scrollEnabled) {
final dy = (_scrollController.position.pixels - event.panDelta.dy);
scrollTo(dy);
}
}
}

View file

@ -49,7 +49,14 @@ class SelectionGestureDetectorState extends State<SelectionGestureDetector> {
gestures: {
PanGestureRecognizer:
GestureRecognizerFactoryWithHandlers<PanGestureRecognizer>(
() => PanGestureRecognizer(),
() => PanGestureRecognizer(supportedDevices: {
// https://docs.flutter.dev/release/breaking-changes/trackpad-gestures#for-gesture-interactions-not-suitable-for-trackpad-usage
// Exclude PointerDeviceKind.trackpad.
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.stylus,
PointerDeviceKind.invertedStylus,
}),
(recognizer) {
recognizer
..onStart = widget.onPanStart

View file

@ -10,8 +10,8 @@ platforms:
web:
environment:
sdk: ">=2.17.0 <3.0.0"
flutter: ">=1.17.0"
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
dependencies:
flutter:

View file

@ -8,7 +8,7 @@ void main() async {
TestWidgetsFlutterBinding.ensureInitialized();
});
Node _createEmptyEditorRoot() {
Node createEmptyEditorRoot() {
return Node(
type: 'editor',
children: LinkedList(),
@ -17,7 +17,7 @@ void main() async {
}
test("HistoryItem #1", () {
final document = Document(root: _createEmptyEditorRoot());
final document = Document(root: createEmptyEditorRoot());
final editorState = EditorState(document: document);
final historyItem = HistoryItem();
@ -35,7 +35,7 @@ void main() async {
});
test("HistoryItem #2", () {
final document = Document(root: _createEmptyEditorRoot());
final document = Document(root: createEmptyEditorRoot());
final editorState = EditorState(document: document);
final historyItem = HistoryItem();