diff --git a/lib/components/bannerimage.dart b/lib/components/bannerimage.dart index ab6146e..b375bf9 100644 --- a/lib/components/bannerimage.dart +++ b/lib/components/bannerimage.dart @@ -8,50 +8,50 @@ class Bannerimage extends StatelessWidget { @override Widget build(BuildContext context) { return ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderRadius: const BorderRadius.all(Radius.circular(5.0)), child: Stack( children: [ Container( - padding: EdgeInsets.all(0.0), - child: new Image.asset( + padding: const EdgeInsets.all(0.0), + child: 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), + padding: const EdgeInsets.only(top: 25.0, left: 10.0), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( + const Text( 'SPRING / SUMMER COLLECTION 2022', style: TextStyle( color: Colors.black, fontSize: 10.5, fontWeight: FontWeight.bold), ), - SizedBox( + const SizedBox( height: 8.0, ), - Text( + const Text( 'Get up to 30% off \nNow Arrivals', style: TextStyle( color: Colors.black, fontSize: 20.0, fontWeight: FontWeight.bold), ), - SizedBox( + const SizedBox( height: 8.0, ), ElevatedButton( - child: Text('SHOP NOW'), onPressed: () {}, style: ElevatedButton.styleFrom( primary: Colors.red, - textStyle: TextStyle( + textStyle: const TextStyle( fontSize: 14, fontWeight: FontWeight.bold)), + child: const Text('SHOP NOW'), ), ]), ) diff --git a/lib/components/carousel.dart b/lib/components/carousel.dart index 4149693..2128dee 100644 --- a/lib/components/carousel.dart +++ b/lib/components/carousel.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:carousel_slider/carousel_slider.dart'; class Carousel extends StatefulWidget { - Carousel({Key? key}) : super(key: key); + const Carousel({Key? key}) : super(key: key); @override State createState() => _CarouselState(); @@ -16,46 +16,44 @@ final List imgList = [ class _CarouselState extends State { final List imageSliders = imgList - .map((item) => Container( - child: Container( - margin: EdgeInsets.all(5.0), - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5.0)), - child: Stack( - children: [ - Image.asset(item, fit: BoxFit.cover, width: 1000.0), - Positioned( - bottom: 0.0, - left: 0.0, - right: 0.0, - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Color.fromARGB(200, 0, 0, 0), - Color.fromARGB(0, 0, 0, 0) - ], - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - ), + .map( + (item) => Container( + margin: const EdgeInsets.all(5.0), + child: ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(5.0)), + child: Stack( + children: [ + Image.asset(item, fit: BoxFit.cover, width: 1000.0), + Positioned( + bottom: 0.0, + left: 0.0, + right: 0.0, + child: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [ + Color.fromARGB(200, 0, 0, 0), + Color.fromARGB(0, 0, 0, 0) + ], + begin: Alignment.bottomCenter, + end: Alignment.topCenter, ), - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 20.0), - child: SizedBox( - width: 1.0, - ) ), - ), - ], - )), - ), - )) + padding: const EdgeInsets.symmetric( + vertical: 10.0, horizontal: 20.0), + child: const SizedBox( + width: 1.0, + )), + ), + ], + )), + ), + ) .toList(); @override Widget build(BuildContext context) { - return Container( - child: CarouselSlider( + return CarouselSlider( options: CarouselOptions( aspectRatio: 2.0, enlargeCenterPage: true, @@ -64,6 +62,6 @@ class _CarouselState extends State { autoPlay: true, ), items: imageSliders, - )); + ); } } diff --git a/lib/components/forgot_pass_body.dart b/lib/components/forgot_pass_body.dart index dbde9f5..e258341 100644 --- a/lib/components/forgot_pass_body.dart +++ b/lib/components/forgot_pass_body.dart @@ -47,7 +47,7 @@ class _ForgotPassBodyState extends State { child: TextField( controller: emailController, keyboardType: TextInputType.emailAddress, - style: TextStyle(color: Colors.white), + style: const TextStyle(color: Colors.white), decoration: InputDecoration( focusedBorder: OutlineInputBorder( borderSide: const BorderSide( diff --git a/lib/components/otp_body.dart b/lib/components/otp_body.dart index f2eb09f..3319040 100644 --- a/lib/components/otp_body.dart +++ b/lib/components/otp_body.dart @@ -227,8 +227,8 @@ class _OtpBodyState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Text( + children: const [ + Text( "Didn't get it?? \t", style: TextStyle(color: Colors.white), ), diff --git a/lib/components/product_card.dart b/lib/components/product_card.dart index 377e7b5..27647f1 100644 --- a/lib/components/product_card.dart +++ b/lib/components/product_card.dart @@ -25,16 +25,16 @@ class ProductCard extends StatelessWidget { width: 154, padding: const EdgeInsets.all(defaultPadding / 2), decoration: const BoxDecoration( - color: const Color(0xff212226), + color: Color(0xff212226), borderRadius: BorderRadius.all(Radius.circular(defaultBorderRadius)), ), child: Column( children: [ Container( width: double.infinity, - decoration: BoxDecoration( - color: const Color(0xff212226), - borderRadius: const BorderRadius.all( + decoration: const BoxDecoration( + color: Color(0xff212226), + borderRadius: BorderRadius.all( Radius.circular(defaultBorderRadius)), ), // child: Image.asset( diff --git a/lib/components/search_form.dart b/lib/components/search_form.dart index 3ab0c1c..f2e51cd 100644 --- a/lib/components/search_form.dart +++ b/lib/components/search_form.dart @@ -22,7 +22,7 @@ class SearchForm extends StatelessWidget { filled: true, fillColor: const Color(0xff212226), hintText: "Search items...", - hintStyle: TextStyle(color: Colors.white), + hintStyle: const TextStyle(color: Colors.white), border: outlineInputBorder, enabledBorder: outlineInputBorder, focusedBorder: outlineInputBorder, diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 47a54ea..fe9333e 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:nekoya_flutter/components/bannerimage.dart'; import 'package:nekoya_flutter/utils/utils.dart'; @@ -43,7 +42,7 @@ class Home extends StatelessWidget { padding: EdgeInsets.symmetric(vertical: defaultPadding), child: SearchForm(), ), - Carousel(), + const Carousel(), const NewArrivalProducts(), const SizedBox( height: 15,