Add Banner on Home Screen
This commit is contained in:
parent
4884a999d3
commit
e18662a90f
3 changed files with 23 additions and 2 deletions
lib
18
lib/components/bannerimage.dart
Normal file
18
lib/components/bannerimage.dart
Normal file
|
@ -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,
|
||||
));
|
||||
}
|
||||
}
|
|
@ -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)),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -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(),
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue