Skip to content

Instantly share code, notes, and snippets.

@TechieBlossom
Last active October 4, 2020 11:45
Show Gist options
  • Save TechieBlossom/7f575f9717a0f17aa5182d16ab273394 to your computer and use it in GitHub Desktop.
Save TechieBlossom/7f575f9717a0f17aa5182d16ab273394 to your computer and use it in GitHub Desktop.
class MovieCardWidget extends StatelessWidget {
//1
final int movieId;
//2
final String posterPath;
const MovieCardWidget({
Key key,
@required this.movieId,
@required this.posterPath,
}) : super(key: key);
@override
Widget build(BuildContext context) {
//6
return Material(
elevation: 32,
borderRadius: BorderRadius.circular(Sizes.dimen_16.w),
//5
child: GestureDetector(
onTap: () {},
//4
child: ClipRRect(
borderRadius: BorderRadius.circular(Sizes.dimen_16.w),
//3
child: CachedNetworkImage(
imageUrl: '${ApiConstants.BASE_IMAGE_URL}$posterPath',
fit: BoxFit.cover,
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment