I passed arguments to next page, and I’m trying to fetch other data using arguments in flutter.
I’m using supabase, the data I’m trying to fetch is thumbNailUrl.
Navigator.of(context).pushNamed(
'/postScreen',
arguments: postId,
);
post_id(int) | thumbNailUrl(String) |
---|---|
~~~ | ~~~ |
But I cannot understand how to fetch thumbNailUrl using arguments, and I want to enter parameters into postImage().
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: Column(
children: [
postImage( ~ ),
.
.
.
],
),
),
);
}
Please help me,,
2
Answers
I barely solve it,, hope it helps others to use supabase and dart.
PostScreen
AnyClass
This is an example you should create a new one for yourself
Source: https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments