Как избавиться от DialogBox при жесте longPressEnd во флаттере - PullRequest
0 голосов
/ 09 марта 2020
                          GestureDetector(
                            child: Text('data'),

                            onLongPress: (){
                              showAlert = true;
                              print('long pressed');
                              print(showAlert);
                              showAlert1();
                            },
                            onLongPressUp: (){
                               showAlert = false;
                               print('long pressed cut');
                               print(showAlert);
                            },
                          ),


showAlert1() {
    return showAlert ? showDialog(
      context: context,
      builder: (BuildContext context) => SizedBox(
        width: 400,
        child: CustomDialog(
          title: 'data',
          description: 'data',
          bluebuttonText: "Ok",
          bluebtnFunc: () {
            Navigator.of(context).pop();
          },
          greybuttonText: null,
          // greybtnFunc: () {
          //   Navigator.of(context).pop();
          // },
        ),
      )
    ) : SizedBox(width: 0, height: 0,);
  }

Ожидаемый результат: OnlongPress Жест показа DialogBox и при onLongPressEnd Жест закрытия открытого диалогового окна.

Проблема: Я не могу обнаружить onLongPressEnd Жест после открытия диалогового окна.

Любая помощь будет оценена.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...