Resize Font New arrival dan best seller
This commit is contained in:
parent
2d3de88fc6
commit
bb54ca0f17
2 changed files with 39 additions and 9 deletions
lib/components
|
@ -1,3 +1,5 @@
|
|||
// ignore_for_file: dead_code
|
||||
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
@ -15,6 +17,8 @@ final List<String> imgList = [
|
|||
];
|
||||
|
||||
class _CarouselState extends State<Carousel> {
|
||||
int _current = 0;
|
||||
final CarouselController _controller = CarouselController();
|
||||
final List<Widget> imageSliders = imgList
|
||||
.map(
|
||||
(item) => Container(
|
||||
|
@ -54,14 +58,39 @@ class _CarouselState extends State<Carousel> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CarouselSlider(
|
||||
options: CarouselOptions(
|
||||
aspectRatio: 2.0,
|
||||
enlargeCenterPage: true,
|
||||
enableInfiniteScroll: false,
|
||||
initialPage: 2,
|
||||
autoPlay: true,
|
||||
),
|
||||
items: imageSliders,
|
||||
carouselController: _controller,
|
||||
options: CarouselOptions(
|
||||
aspectRatio: 2.0,
|
||||
enlargeCenterPage: true,
|
||||
enableInfiniteScroll: false,
|
||||
initialPage: 2,
|
||||
autoPlay: true,
|
||||
onPageChanged: (index, reason) {
|
||||
setState(() {
|
||||
_current = index;
|
||||
});
|
||||
}),
|
||||
);
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: imgList.asMap().entries.map((entry) {
|
||||
return GestureDetector(
|
||||
onTap: () => _controller.animateToPage(entry.key),
|
||||
child: Container(
|
||||
width: 12.0,
|
||||
height: 12.0,
|
||||
margin:
|
||||
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: (Theme.of(context).brightness == Brightness.dark
|
||||
? Colors.white
|
||||
: Colors.white
|
||||
.withOpacity(_current == entry.key ? 0.9 : 0.4)),
|
||||
),
|
||||
));
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,13 +12,14 @@ class SectionTitle extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.subtitle1!.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
)
|
||||
],
|
||||
|
|
Loading…
Add table
Reference in a new issue