diff --git a/assets/slider_1.webp b/assets/slider_1.webp new file mode 100644 index 0000000..e13696f Binary files /dev/null and b/assets/slider_1.webp differ diff --git a/lib/components/bannerimage.dart b/lib/components/bannerimage.dart index 49d31c5..ab6146e 100644 --- a/lib/components/bannerimage.dart +++ b/lib/components/bannerimage.dart @@ -7,13 +7,55 @@ class Bannerimage extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - padding: EdgeInsets.all(0.0), - child: new Image.asset( - 'assets/Carousel_1.webp', - width: 600.0, - height: 200.0, - fit: BoxFit.fill, + return ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + child: Stack( + children: [ + Container( + padding: EdgeInsets.all(0.0), + child: new Image.asset( + 'assets/slider_1.webp', + width: 600.0, + height: 180.0, + 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)), + ), + ]), + ) + ], )); } } diff --git a/lib/components/popular_products.dart b/lib/components/popular_products.dart index 8d856e5..11c087b 100644 --- a/lib/components/popular_products.dart +++ b/lib/components/popular_products.dart @@ -18,68 +18,70 @@ class PopularProducts extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(vertical: defaultPadding), child: SectionTitle( - title: "Popular", + title: "Best Seller", pressSeeAll: () {}, ), ), FutureBuilder( - future: getProducts(), - builder: (context, snapshot) { - if (snapshot.hasData) { - var sourceData = snapshot.data; - sourceData.shuffle(); - var data = sourceData.take(6).toList(); - return SingleChildScrollView( - physics: const BouncingScrollPhysics( - parent: AlwaysScrollableScrollPhysics()), - scrollDirection: Axis.horizontal, - child: Row( - children: List.generate( - data.length, - (index) => Padding( - padding: const EdgeInsets.only(right: defaultPadding), - child: ProductCard( - title: data[index]['TITLE'], - imageUrl: "https://nekoya.moe.team/img/${data[index]['IMAGE']}", - price: 99, - bgColor: const Color(0xFFFEFBF9), - press: () { - showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) => productDetail(context, data[index]['ID']), - ); - }, + future: getProducts(), + builder: (context, snapshot) { + if (snapshot.hasData) { + var sourceData = snapshot.data; + sourceData.shuffle(); + var data = sourceData.take(6).toList(); + return SingleChildScrollView( + physics: const BouncingScrollPhysics( + parent: AlwaysScrollableScrollPhysics()), + scrollDirection: Axis.horizontal, + child: Row( + children: List.generate( + data.length, + (index) => Padding( + padding: const EdgeInsets.only(right: defaultPadding), + child: ProductCard( + title: data[index]['TITLE'], + imageUrl: + "https://nekoya.moe.team/img/${data[index]['IMAGE']}", + price: 99, + bgColor: const Color(0xFFFEFBF9), + press: () { + showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) => + productDetail(context, data[index]['ID']), + ); + }, + ), ), ), ), - ), - ); - } else { - return SingleChildScrollView( - physics: const BouncingScrollPhysics( - parent: AlwaysScrollableScrollPhysics()), - scrollDirection: Axis.horizontal, - child: Row( - children: List.generate( - 6, - (index) => Padding( - padding: const EdgeInsets.only(right: defaultPadding), - child: ProductCard( - title: 'Loading...', - imageUrl: "https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp", - price: 99, - bgColor: const Color(0xFFFEFBF9), - press: () {}, + ); + } else { + return SingleChildScrollView( + physics: const BouncingScrollPhysics( + parent: AlwaysScrollableScrollPhysics()), + scrollDirection: Axis.horizontal, + child: Row( + children: List.generate( + 6, + (index) => Padding( + padding: const EdgeInsets.only(right: defaultPadding), + child: ProductCard( + title: 'Loading...', + imageUrl: + "https://i.ibb.co/QJFLZC4/La-Darknesss-Portrait.webp", + price: 99, + bgColor: const Color(0xFFFEFBF9), + press: () {}, + ), ), ), ), - ), - ); - } - } - ) + ); + } + }) ], ); } diff --git a/pubspec.lock b/pubspec.lock index 38f7cce..1525fbe 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -8,6 +8,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + app: + dependency: "direct main" + description: + name: app + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" archive: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 68f3ec6..bc4f5e6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,6 +44,7 @@ dependencies: shared_preferences: ^2.0.13 universal_html: ^2.0.8 carousel_slider: ^4.1.1 + app: ^0.0.3 dev_dependencies: flutter_lints: ^2.0.1