-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果在刚进入一个页面的时候就显示easyloading.show,我该在哪里调用呢 #7
Comments
@NSChris |
@huangjianke demo新建一个如下的Home.dart文件 class HomePage extends StatefulWidget { @OverRide class _HomePageState extends State { void setDS() { @OverRide |
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return FlutterEasyLoading(
child: MaterialApp(
title: 'Flutter EasyLoading',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter EasyLoading'),
),
);
}
} 确认下这里是否有用 |
@huangjianke |
我觉得是因为initState()的生命周期是在BuildContext之前的 |
好的,我调试下 |
我在dev分支调整了下,你那边本地可以修改一下试试,我这边再测试下,后面没什么问题会尽快发布新版。 感谢反馈 |
@huangjianke |
|
@huangjianke |
好的。 |
@NSChris 发布了新版,在 WidgetsBinding.instance.addPostFrameCallback((_) {
EasyLoading.showSuccess('Great Success!');
}); |
@huangjianke 好的 我晚上试试 谢谢提醒 |
@huangjianke 换上了是可以用,但是感觉没有之前用着方便,暂时这样用吧 |
因为在 |
好的 先这样用着 |
比如我刚进入一个页面
在他的initState我在后台取数据,这时候需要一个loading显示,然后取完数据loading消失
像我上面这样调用的话会报出找不到buildContext的错误
那我要怎么调用它呢,谢谢
The text was updated successfully, but these errors were encountered: