September 2019
Beginner
512 pages
12h 52m
English
Material Design and iOS Cupertino widgets have many gestures abstracted to some property by using the GestureDetector widget internally in their code. For example, material widgets such as RaisedButton use the InkWell widget beside the tap event. It does the splash effect on the target widget. Also, the onPressed property of RaisedButton exposes the tap functionality that can be used to implement the action of the button. Consider the following example:
// part of main.dart file (attached "input" directory example)RaisedButton( onPressed: () { print("Running validation"); // ... validate }, child: Text("validate"),)
A Text child is displayed in the RaisedButton and its press is handled in the onPressed method, ...
Read now
Unlock full access