Skip to content

Commit

Permalink
update 6.x/ny-future-builder.md
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Nov 13, 2024
1 parent 454ffa6 commit 8ca920e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions resources/docs/6.x/ny-future-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Container(
child: NyFutureBuilder(future: _findUserName(), child: (context, data) {
child: NyFutureBuilder<String>(future: _findUserName(), child: (context, data) {
// data = "John Doe"
return Text(data!);
},),
Expand Down Expand Up @@ -64,8 +64,7 @@ Widget build(BuildContext context) {
child: (context, data) {
return Text(data);
},
loading: CupertinoActivityIndicator(), // change the default loader
useSkeletonizer: true, // enable the skeletonizer effect
loadingStyle: LoadingStyle.normal(child: Text("Loading...")), // change the default loader
onError: (AsyncSnapshot snapshot) { // handle exceptions thrown from your future.
print(snapshot.error.toString());
return Text("Error");
Expand Down

0 comments on commit 8ca920e

Please sign in to comment.