You are on page 1of 2

import 'package:flutter/material.

dart';

class FeaturedProductsView extends StatelessWidget {


@override
Widget build(BuildContext context) {
return Container(
height: 230,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.blue, Colors.purple],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: 5, // Adjust the count based on your actual number of featured
products
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 10.0),
child: Stack(
children: <Widget>[
Container(
width: 300,
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: AssetImage('assets/featured$index.jpg'), // Replace
with your image paths
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: Colors.black45,
blurRadius: 5.0,
offset: Offset(0, 5),
),
],
),
),
Positioned(
bottom: 10,
left: 10,
child: Text(
'Product ${index + 1}',
style: TextStyle(
fontSize: 24,
color: Colors.white,
shadows: <Shadow>[
Shadow(
offset: Offset(0.0, 2.0),
blurRadius: 3.0,
color: Color.fromARGB(150, 0, 0, 0),
),
],
),
),
),
],
),
);
},
),
);
}
}

You might also like