一.手势:

 

GestureDetector(
      onTap: () {
        print('MyButton was tapped!');
      },

 the IconButton, RaisedButton, and FloatingActionButton widgets have onPressed callbacks that are triggered when the user taps the widge

 

 

二.Stateless widgets & StatefulWidgets

Stateless widgets receive arguments from their parent widget, which they store in final member variables

StatefulWidgets are special widgets that know how to generate State objects, which are then used to hold state.

 

StatefulWidget and State are separate objects. In Flutter, these two types of objects have different life cycles.

State objects on the other hand are persistent between calls to build(), allowing them to remember information.

 

 

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐