-
nylo_framework: ^5.21.9
|
Beta Was this translation helpful? Give feedback.
Answered by
agordn52
Mar 22, 2024
Replies: 1 comment
-
Hi @andim27, You need to ensure that any async tasks use @override
boot() async {
await loadItems();
}
Future loadItems() async {
await sleep(2); // fetch your data here
} Or you can use the class _TestPageState extends NyState<TestPage> {
@override
boot() async {
await loadItems();
}
Future loadItems() async {
await sleep(2);
}
@override
Widget loading(BuildContext context) {
return Scaffold(
body: Center(
child: SizedBox(
width: 80,
height: 80,
child: CircularProgressIndicator(),
),
),
);
}
@override
Widget view(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: SafeArea(
child: Container(
color: ThemeColor.get(context).background,
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height,
child: Text('data'))),
);
}
} Hope that helps 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
andim27
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @andim27,
You need to ensure that any async tasks use
await
in theboot
method.Or you can use the
view
method which would look like this.