Code Monkey home page Code Monkey logo

Comments (6)

esDotDev avatar esDotDev commented on August 19, 2024 2

We've refactored the example to allow for embedded buttons :)

from flutter_vignettes.

masterashu avatar masterashu commented on August 19, 2024

This happens because the FlightBarcode is Wrapped inside a Gesture detector here.

from flutter_vignettes.

masterashu avatar masterashu commented on August 19, 2024

You can refer here to find how to that behavior.

from flutter_vignettes.

ricardogobbo avatar ricardogobbo commented on August 19, 2024

That's an unexpected behavior.

Look at this Widget. When I tap on red container, onTap is fired. When I press the button, onPressed is triggered.

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("GestureDetector Test")),
      body: Column(
        children: <Widget>[
          GestureDetector(
            onTap: () => print("gestureDetector onTap"),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: <Widget>[
                Container(
                  color: Colors.red, 
                  height: 200, 
                  child: Text("Gesture"),
                ),
                FlatButton(
                  child: Text("button"), 
                  onPressed: () => print("button onPressed"),
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}

from flutter_vignettes.

masterashu avatar masterashu commented on August 19, 2024

In the Flutter documentation here it is mentioned that in Gesture Arena only one of the Gesture is declared as victorious. This might differ from one case to another case. Hence it requires custom GestureDetectors.

from flutter_vignettes.

ricardogobbo avatar ricardogobbo commented on August 19, 2024

Gesture arena didn't recognize button onPressed gesture.

Gesture arena 48   ❙ ★ Opening new gesture arena.
// GestureDetector's onTap 
Gesture arena 48   ❙ Adding: TapGestureRecognizer#6cdd6(debugOwner: GestureDetector, state: ready, button: 1)
// ListView scroll
Gesture arena 48   ❙ Adding: VerticalDragGestureRecognizer#675e5(start behavior: start)
Gesture arena 48   ❙ Closing with 2 members.
Gesture arena 48   ❙ Rejecting: VerticalDragGestureRecognizer#675e5(start behavior: start)
Gesture arena 48   ❙ Sweeping with 1 member.
Gesture arena 48   ❙ Winner: TapGestureRecognizer#6cdd6(debugOwner: GestureDetector, state: ready, finalPosition: Offset(129.4, 493.4), finalLocalPosition: Offset(129.4, 380.3), button: 1, sent tap down)

from flutter_vignettes.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.