Add Text and button on banner

This commit is contained in:
Kelvin Samuel 2022-05-15 23:52:34 +07:00
parent e2e788b68c
commit cae095f701
5 changed files with 111 additions and 59 deletions

BIN
assets/slider_1.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -7,13 +7,55 @@ class Bannerimage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5.0)),
child: Stack(
children: [
Container(
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
child: new Image.asset( child: new Image.asset(
'assets/Carousel_1.webp', 'assets/slider_1.webp',
width: 600.0, width: 600.0,
height: 200.0, height: 180.0,
fit: BoxFit.fill, fit: BoxFit.fill,
)),
Padding(
padding: EdgeInsets.only(top: 25.0, left: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'SPRING / SUMMER COLLECTION 2022',
style: TextStyle(
color: Colors.black,
fontSize: 10.5,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 8.0,
),
Text(
'Get up to 30% off \nNow Arrivals',
style: TextStyle(
color: Colors.black,
fontSize: 20.0,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 8.0,
),
ElevatedButton(
child: Text('SHOP NOW'),
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Colors.red,
textStyle: TextStyle(
fontSize: 14, fontWeight: FontWeight.bold)),
),
]),
)
],
)); ));
} }
} }

View file

@ -18,7 +18,7 @@ class PopularProducts extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: defaultPadding), padding: const EdgeInsets.symmetric(vertical: defaultPadding),
child: SectionTitle( child: SectionTitle(
title: "Popular", title: "Best Seller",
pressSeeAll: () {}, pressSeeAll: () {},
), ),
), ),
@ -40,7 +40,8 @@ class PopularProducts extends StatelessWidget {
padding: const EdgeInsets.only(right: defaultPadding), padding: const EdgeInsets.only(right: defaultPadding),
child: ProductCard( child: ProductCard(
title: data[index]['TITLE'], title: data[index]['TITLE'],
imageUrl: "https://nekoya.moe.team/img/${data[index]['IMAGE']}", imageUrl:
"https://nekoya.moe.team/img/${data[index]['IMAGE']}",
price: 99, price: 99,
bgColor: const Color(0xFFFEFBF9), bgColor: const Color(0xFFFEFBF9),
press: () { press: () {
@ -48,7 +49,8 @@ class PopularProducts extends StatelessWidget {
isScrollControlled: true, isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
context: context, context: context,
builder: (context) => productDetail(context, data[index]['ID']), builder: (context) =>
productDetail(context, data[index]['ID']),
); );
}, },
), ),
@ -68,7 +70,8 @@ class PopularProducts extends StatelessWidget {
padding: const EdgeInsets.only(right: defaultPadding), padding: const EdgeInsets.only(right: defaultPadding),
child: ProductCard( child: ProductCard(
title: 'Loading...', title: 'Loading...',
imageUrl: "https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp", imageUrl:
"https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp",
price: 99, price: 99,
bgColor: const Color(0xFFFEFBF9), bgColor: const Color(0xFFFEFBF9),
press: () {}, press: () {},
@ -78,8 +81,7 @@ class PopularProducts extends StatelessWidget {
), ),
); );
} }
} })
)
], ],
); );
} }

View file

@ -8,6 +8,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
app:
dependency: "direct main"
description:
name: app
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
archive: archive:
dependency: transitive dependency: transitive
description: description:

View file

@ -44,6 +44,7 @@ dependencies:
shared_preferences: ^2.0.13 shared_preferences: ^2.0.13
universal_html: ^2.0.8 universal_html: ^2.0.8
carousel_slider: ^4.1.1 carousel_slider: ^4.1.1
app: ^0.0.3
dev_dependencies: dev_dependencies:
flutter_lints: ^2.0.1 flutter_lints: ^2.0.1