-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isTap() method not working properly? #52
Comments
will look into it in the next couple days. Could you please provide your code where the error occurs? |
Here you have it, thanks for the quick response :) `import 'package:cloud_firestore/cloud_firestore.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { class MyHomePage extends StatefulWidget { final String title; @OverRide class _MyHomePageState extends State { @OverRide class SectionItem extends StatefulWidget { final IconData icon; @OverRide class _SectionItemState extends State { @OverRide
} void _goToSection(String navigator) async {
} final settingsItemStyle = (pressed) => ParentStyle() final settingsItemIconStyle = (Color color) => ParentStyle() final TxtStyle itemTitleTextStyle = TxtStyle() final TxtStyle itemDescriptionTextStyle = TxtStyle() |
Not entirely sure what the problem is but i think the problem is just an illusion when testing on a emulator. What feels like a long press on a emulator can be a normal tap on a real device. ..isTap((isTapped) {
print("The item was tapped $isTapped");
_goToSection(widget.navigator);
setState(() => pressed = isTapped);
} When the setState function is called the widget will rerender. Therefore everthing you want to do should be done before you call setState. Let me know if this helped. I would also suggest testing it on a real device if you havent yet to see if there is a problem in a "real" scenario. |
The problem still persists, even on a real device. _goToSection(widget.navigator); is executed TWICE only when a long press is release. Thanks in advance. |
It seems to be triggered only when a long press is made over a Parent. Additionally, it is triggered twice in that case (at least for me).
The text was updated successfully, but these errors were encountered: