哪个小部件可用于解释应用程序中的功能

问题描述 投票:-1回答:1

我想在我的应用程序中解释一些内容并添加一个看起来像通知或聊天的小部件。我希望这个小部件在一段时间内可见,然后被解雇。我尝试使用tooltip,但只有当我点击它时它才可见。我可以使用哪个小部件?

flutter widget label tooltip
1个回答
0
投票

Dart包intro_views_flutter是你需要的,但它的一个主要限制是它全屏显示,如果这不是你的问题,那么你应该看看它。或者你可以这样在showDialog函数中使用Future方法:

 Future showNotification() async {
  showDialog<String>(
     context: context,
     child: new AlertDialog(
          title: Text('Note!') ,
          contentPadding: const EdgeInsets.all(16.0),
          content: //any widget you want to display here                         
      ),
    );
  await new Future.delayed(const Duration(seconds: 5), () {
     Navigator.of(context).pop(); // this will dismiss the dialog automatically after five seconds
  }
}

然后当你需要它时:

 showNotificaion();
© www.soinside.com 2019 - 2024. All rights reserved.