如果单击在抽屉右上角创建的关闭按钮,是否有关闭抽屉的方法。
抽屉模拟:
只需调用Navigator.of(context).pop();
示例:
ListTile( title: Text('Item 1'), onTap: () { // Update the state of the app. // ... // Then close the drawer. Navigator.pop(context); }, ),