Flutter: ошибка при использовании виджета NotificationListener @ _ @

У меня такая ошибка:

      'package:flutter/src/widgets/scroll_activity.dart': Failed assertion: line 450 pos 12: 'lastDetails is DragUpdateDetails': is not true.

при использовании виджета NotificationListener, а мой демонстрационный виджет NotificationListener выглядит так:

      PageView(
  controller: _parentPageCtrl
  children: [
    Scaffold(),
    NotificationListener(
      onNotification: (notification) {
        if (notification is ScrollStartNotification) {
          _dragStartDetails = notification.dragDetails;
        }
        if (notification is UserScrollNotification &&
            notification.direction == ScrollDirection.reverse &&
            _dragStartDetails != null) {
          _parentPageCtrl.position.drag(_dragStartDetails!);
        }
        return true;
    },
    child: PageView(
      controller: _childPageCtrl,
      onPageChanged: _theHomeUI.updateChildPageIndex,
      children: _childTabs,
    ),
  ),
  Scaffold(),
],
)

0 ответов

Другие вопросы по тегам