diff --git a/lib/components/bannerimage.dart b/lib/components/bannerimage.dart new file mode 100644 index 0000000..53c0198 --- /dev/null +++ b/lib/components/bannerimage.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; + +class Bannerimage extends StatelessWidget { + const Bannerimage({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(20.0), + child: new Image.asset( + 'assets/Carousel_1.webp', + width: 100.0, + height: 200.0, + )); + } +} diff --git a/lib/components/carouselwithindicatordemo.dart b/lib/components/carouselwithindicatordemo.dart index ad2c40e..cbb06bd 100644 --- a/lib/components/carouselwithindicatordemo.dart +++ b/lib/components/carouselwithindicatordemo.dart @@ -15,7 +15,7 @@ class _CarouselWithIndicatorState extends State<CarouselWithIndicatorDemo> { Container( decoration: BoxDecoration( image: - DecorationImage(image: AssetImage('assets/Carousel_1.webp')))) + DecorationImage(image: AssetImage("assets/Carousel_1.webp")))) ]; @override @@ -26,6 +26,7 @@ class _CarouselWithIndicatorState extends State<CarouselWithIndicatorDemo> { items: imgList, carouselController: _controller, options: CarouselOptions( + height: 202, autoPlay: true, enlargeCenterPage: true, aspectRatio: 2.0, @@ -48,7 +49,7 @@ class _CarouselWithIndicatorState extends State<CarouselWithIndicatorDemo> { shape: BoxShape.circle, color: (Theme.of(context).brightness == Brightness.dark ? Colors.white - : Colors.black) + : Colors.white) .withOpacity(_current == entry.key ? 0.9 : 0.4)), ), ); diff --git a/lib/screens/home.dart b/lib/screens/home.dart index ee32447..c23a111 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:nekoya_flutter/components/bannerimage.dart'; import 'package:nekoya_flutter/components/carouselwithindicatordemo.dart'; import 'package:nekoya_flutter/utils/utils.dart'; @@ -45,6 +46,7 @@ class Home extends StatelessWidget { const Categories(), CarouselWithIndicatorDemo(), const NewArrivalProducts(), + const Bannerimage(), const PopularProducts(), ], ),