Flutter GetX Snackbar with no context

          RaisedButton(
            child: Text('snackbar'),
            onPressed: () {
              Get.snackbar('标题', '网络错误!',
                  colorText: Colors.white, backgroundColor: Colors.black87);
            },
          ),

完整视频教程查看
https://www.bilibili.com/video/BV1e5411N757?p=3

你可能感兴趣的:(Flutter GetX Snackbar with no context)