Skip to content

Instantly share code, notes, and snippets.

@rrifafauzikomara
Created October 31, 2020 16:53
Show Gist options
  • Save rrifafauzikomara/2dcb049f8462ea6a58a6709ced7b0231 to your computer and use it in GitHub Desktop.
Save rrifafauzikomara/2dcb049f8462ea6a58a6709ced7b0231 to your computer and use it in GitHub Desktop.
class DetailPage extends StatelessWidget {
final String image;
final int id;
DetailPage({@required this.id, @required this.image});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: NestedScrollView(
headerSliverBuilder: (context, isScrolled) {
return [
Hero(tag: id, child: Image.network(image));
];
},
body: // your body widget to show the data from the API.
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment