Skip to content

Commit 1f557b0

Browse files
committed
task: adjusting home carousel size
1 parent 3bbdcb5 commit 1f557b0

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

lib/components/home_carousel.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Widget kSlideContainer(String imgUrl) {
3131
CarouselSlider buildCarouselSlider() {
3232
return CarouselSlider.builder(
3333
options: CarouselOptions(
34-
viewportFraction: 0.7,
34+
viewportFraction: 0.6,
3535
aspectRatio: 2.0,
3636
height: 250,
3737
enlargeStrategy: CenterPageEnlargeStrategy.scale,

lib/views/main/customer/home.dart

+20-7
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ class HomeScreen extends StatefulWidget {
1717

1818
class _HomeScreenState extends State<HomeScreen> {
1919
var currentTabIndex = 0;
20-
21-
var categories = ['Men', 'Women', 'Children', 'Sneakers', 'Others'];
20+
var categories = [
21+
'Men',
22+
'Women',
23+
'Children',
24+
'Sneakers',
25+
'Others',
26+
];
2227

2328
final categoriesList = const [
2429
MenWears(),
@@ -39,9 +44,9 @@ class _HomeScreenState extends State<HomeScreen> {
3944
text,
4045
style: TextStyle(
4146
color: currentTabIndex == index ? Colors.black : Colors.grey,
42-
fontSize: currentTabIndex == index ? 37 : 28,
47+
fontSize: currentTabIndex == index ? 27 : 18,
4348
fontWeight:
44-
currentTabIndex == index ? FontWeight.bold : FontWeight.w500,
49+
currentTabIndex == index ? FontWeight.bold : FontWeight.w500,
4550
),
4651
),
4752
),
@@ -61,9 +66,9 @@ class _HomeScreenState extends State<HomeScreen> {
6166
margin: const EdgeInsets.symmetric(horizontal: 18),
6267
child: const SearchBox(),
6368
),
64-
const SizedBox(height: 20),
69+
const SizedBox(height: 10),
6570
buildCarouselSlider(),
66-
const SizedBox(height: 15),
71+
const SizedBox(height: 10),
6772
SizedBox(
6873
height: 40,
6974
child: ListView.builder(
@@ -75,7 +80,15 @@ class _HomeScreenState extends State<HomeScreen> {
7580
),
7681
SizedBox(
7782
height: MediaQuery.of(context).size.height / 1,
78-
child: categoriesList[currentTabIndex],
83+
child: Column(
84+
children: [
85+
categoriesList[currentTabIndex],
86+
const SizedBox(
87+
height: 10,
88+
),
89+
Text('Other Contents can come in.....')
90+
],
91+
),
7992
),
8093
],
8194
),

0 commit comments

Comments
 (0)