简体   繁体   中英

Why the ontap property of gesture detector is not working on a second consecutive tap in flutter?

(ie, ontap > navigation happens > back click, again ontap > no navigation)

             GestureDetector(
                      onTap: () => model.navigateToSetting(),
                      child: ListTile(
                        
                        title: Text(
                          'Settings',
                          semanticsLabel: 'Settings',
                          style: Theme.of(context)
                              .primaryTextTheme
                              .headline6!
                              .copyWith(
                                fontSize: 22.0,
                                fontWeight: FontWeight.bold,
                              ),
                        ),
                        subtitle: Text(
                          'Notifications, Feedback, App Info, Terms & Privacy Policy, Logout',
                          style: Theme.of(context)
                              .textTheme
                              .subtitle2!
                              .copyWith(
                                  color: Theme.of(context).primaryColor,
                                  fontSize: 15),
                          semanticsLabel:
                              'Notifications, Feedback, App Info, Terms & Privacy Policy, Logout',
                        ),
                      ),
                    ),

GestureDetector may not be working because it also has a double click function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM