Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LimitedBox(
- maxHeight: 100,
- child: ListView.builder(
- shrinkWrap: true,
- scrollDirection: Axis.horizontal,
- itemCount:
- context
- .watch<CommonProvider>()
- .productDetailsResponse
- ?.data
- ?.relatedItems
- ?.data
- ?.length,
- itemBuilder: (BuildContext context, int position) {
- return GestureDetector(
- onTap: () {
- Navigator.of(context).push(
- MaterialPageRoute(
- builder:
- (context) => ProductDetailsPage(
- args: {
- "id":
- context
- .read<CommonProvider>()
- .productDetailsResponse
- ?.data
- ?.relatedItems
- ?.data?[position]
- ?.id,
- },
- ),
- ),
- );
- },
- child: Card(
- color: ProjectColors().white,
- elevation: 0,
- shape: RoundedRectangleBorder(
- side: BorderSide(
- width: 1,
- color: ProjectColors().white,
- ),
- borderRadius: BorderRadius.all(Radius.circular(10)),
- ),
- margin: EdgeInsets.all(5),
- child: Padding(
- padding: EdgeInsets.all(0),
- child: SizedBox(
- width: 56,
- height: 56,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- CircleAvatar(
- radius: 28,
- child: CachedNetworkImage(
- height: 60,
- width: 60,
- imageUrl:
- context
- .watch<CommonProvider>()
- .productDetailsResponse
- ?.data
- ?.relatedItems
- ?.data?[position]
- ?.imageUrl ??
- "",
- placeholder:
- (context, url) => Image.asset(
- "assets/images/placeholder_image.png",
- height: 60,
- width: 60,
- fit: BoxFit.fill,
- scale: 10,
- ),
- errorWidget:
- (context, url, error) => Image.asset(
- "assets/images/placeholder_image.png",
- height: 60,
- width: 60,
- fit: BoxFit.fill,
- scale: 10,
- ),
- fit: BoxFit.cover,
- imageBuilder:
- (context, imageProvider) => CircleAvatar(
- backgroundImage: imageProvider,
- ),
- ),
- ),
- Text(
- context
- .watch<CommonProvider>()
- .productDetailsResponse
- ?.data
- ?.relatedItems
- ?.data?[position]
- ?.name ??
- "",
- style: GoogleFonts.roboto(
- fontSize: 12,
- fontWeight: FontWeight.w500,
- color: ProjectColors().blue2,
- ),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- textAlign: TextAlign.center,
- ),
- ],
- ),
- ),
- ),
- ),
- );
- },
- ),
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement