2

我对SyncFusion 的颤动日历有疑问,此屏幕截图SfCalendar显示了与其他孩子一起在 a 中的月份Column(另见最小可重复示例代码的结尾):

在此处输入图像描述

问题很简单:当触摸点从其他孩子开始时,垂直滚动工作正常Column,但是当触摸点开始于 时,SfCalendar则不Column滚动。日历似乎完全吸收了所有垂直拖动触摸手势。这非常烦人,因为月份模式下的 SfCalendar 没有使用垂直拖动手势,所以它确实应该允许列滚动。

debugPrintGestureArenaDiagnostics = true当您尝试在日历上垂直滚动时,设置会显示发生了什么:

I/flutter (15390): Gesture arena 24   ❙ ★ Opening new gesture arena.
I/flutter (15390): Gesture arena 24   ❙ Adding: TapGestureRecognizer#6f41b(debugOwner: GestureDetector, state: ready, button: 1)
I/flutter (15390): Gesture arena 24   ❙ Adding: TapGestureRecognizer#0240c(debugOwner: GestureDetector, state: ready, button: 1)
I/flutter (15390): Gesture arena 24   ❙ Adding: VerticalDragGestureRecognizer#736cf(debugOwner: GestureDetector, start behavior: start)
I/flutter (15390): Gesture arena 24   ❙ Adding: HorizontalDragGestureRecognizer#bde3d(debugOwner: GestureDetector, start behavior: start)
I/flutter (15390): Gesture arena 24   ❙ Adding: VerticalDragGestureRecognizer#5137d(start behavior: start)
I/flutter (15390): Gesture arena 24   ❙ Closing with 5 members.
I/flutter (15390): Gesture arena 24   ❙ Rejecting: TapGestureRecognizer#6f41b(debugOwner: GestureDetector, state: possible, button: 1, sent tap down)
I/flutter (15390): Gesture arena 24   ❙ Rejecting: TapGestureRecognizer#0240c(debugOwner: GestureDetector, state: possible, button: 1, sent tap down)
I/flutter (15390): Gesture arena 24   ❙ Accepting: VerticalDragGestureRecognizer#736cf(debugOwner: GestureDetector, start behavior: start)
I/flutter (15390): Gesture arena 24   ❙ Self-declared winner: VerticalDragGestureRecognizer#736cf(debugOwner: GestureDetector, start behavior: start)

似乎有两个VerticalDragGestureRecognizers - 我猜一个是那个SingleChildScrollView,另一个是SfCalendar(同样,我不知道为什么日历有一个垂直拖动识别器,因为它没有垂直拖动功能)。看起来日历赢得了垂直拖动的舞台,然后只是吞下事件并且什么都不做。

所以我的问题是:

我如何让我SingleChildScrollView在竞技场上获胜?或者有没有其他方法可以使这项工作?

最小的可重现示例:

发布规范.yaml

name: syncfusioncalendarscroll
description: A new Flutter application.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  syncfusion_flutter_calendar: ^18.1.59-beta

flutter:
  uses-material-design: true

主要.dart

import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';

void main() {
  debugPrintGestureArenaDiagnostics = true;
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            SizedBox(
              height: 700,
              child: Placeholder(color: Colors.amber),
            ),
            SfCalendar(
              view: CalendarView.month,
            ),
            SizedBox(
              height: 700,
              child: Placeholder(color: Colors.blue),
            ),
          ],
        ),
      )
    );
  }
}

4

1 回答 1

0

我们已经找到并修复了报告的问题“当接触点在列内的日历上时滚动不起作用”。我们将在即将推出的第 2 卷版本中包含问题修复,预计将于本周末推出。

您也可以通过我们的支持论坛Direct-Trac反馈门户与我们联系。我们随时乐意为您提供帮助!

于 2020-06-30T09:51:27.500 回答