diff --git a/android/app/build.gradle b/android/app/build.gradle index 580a8a8..cd9579b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -64,4 +64,7 @@ dependencies { implementation platform('com.google.firebase:firebase-bom:26.6.0') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.gms:play-services-ads:19.7.0' +} +task wrapper(type: Wrapper){ + gradleVersion = '4.1.2' } \ No newline at end of file diff --git a/lib/helpers/ad_state.dart b/lib/helpers/ad_state.dart index 176b63b..d1599de 100644 --- a/lib/helpers/ad_state.dart +++ b/lib/helpers/ad_state.dart @@ -13,7 +13,8 @@ class AdState { final BannerAdListener _adListener = BannerAdListener( onAdLoaded: (Ad ad) => debugPrint('Ad loaded: ${ad.adUnitId}'), onAdClosed: (Ad ad) => debugPrint('Ad closed: ${ad.adUnitId}'), - onAdFailedToLoad: (Ad ad, LoadAdError error) => debugPrint('Ad failed: ${ad.adUnitId}, $error'), + onAdFailedToLoad: (Ad ad, LoadAdError error) => + debugPrint('Ad failed: ${ad.adUnitId}, $error'), onAdOpened: (Ad ad) => debugPrint('Ad opener: ${ad.adUnitId}'), ); } diff --git a/lib/widgets/product/product_card.dart b/lib/widgets/product/product_card.dart index 28530ae..9648607 100644 --- a/lib/widgets/product/product_card.dart +++ b/lib/widgets/product/product_card.dart @@ -2,17 +2,24 @@ import 'package:flutter/material.dart'; import 'package:relic_bazaar/helpers/constants.dart'; import 'package:relic_bazaar/model/product_model.dart'; -class ProductCard extends StatelessWidget { +class ProductCard extends StatefulWidget { const ProductCard({Key? key, this.product}) : super(key: key); final Product? product; + @override + State createState() => _ProductCardState(); +} + +class _ProductCardState extends State { @override Widget build(BuildContext context) { + final double height = MediaQuery.of(context).size.height; + final double width = MediaQuery.of(context).size.width; return GestureDetector( onTap: () { Navigator.of(context).pushNamed( RouteConstant.PRODUCTS_SCREEN, - arguments: product, + arguments: widget.product, ); }, child: Container( @@ -22,8 +29,8 @@ class ProductCard extends StatelessWidget { borderRadius: BorderRadius.circular(5.0), color: RelicColors.primaryColor, border: Border.all(color: RelicColors.primaryBlack), - boxShadow: const [ - BoxShadow( + boxShadow: [ + const BoxShadow( color: RelicColors.secondaryBlack, offset: Offset(0, 3), blurRadius: 6, @@ -36,7 +43,7 @@ class ProductCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - product!.text!, + widget.product!.text!, style: const TextStyle( fontSize: 18, color: Colors.white, @@ -46,7 +53,7 @@ class ProductCard extends StatelessWidget { textAlign: TextAlign.left, ), Text( - product!.owner!, + widget.product!.owner!, style: const TextStyle( fontSize: 11, color: Colors.white, @@ -59,7 +66,7 @@ class ProductCard extends StatelessWidget { height: 20, ), Text( - product!.amount!, + widget.product!.amount!, style: const TextStyle( fontSize: 18, color: Colors.white, @@ -68,12 +75,15 @@ class ProductCard extends StatelessWidget { ), textAlign: TextAlign.left, ), - Transform.translate( - offset: const Offset(16, 10), - child: Image.asset( - product!.image!, - height: 148, - width: 154, + Container( + height: height * 1 / 6, + width: width * 1 / 3, + child: Transform.translate( + offset: const Offset(16, 10), + child: Image.asset( + widget.product!.image!, + fit: BoxFit.fitHeight, + ), ), ) ], diff --git a/lib/widgets/product/product_page.dart b/lib/widgets/product/product_page.dart index 450d4e5..76a1512 100644 --- a/lib/widgets/product/product_page.dart +++ b/lib/widgets/product/product_page.dart @@ -78,85 +78,65 @@ class _ProductPageState extends State { image: AssetImage('assets/background.png'))), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 18), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - width: width / 1.84, - height: height / 8.43, - child: Text( - widget.product!.text!, - style: const TextStyle( - fontSize: 30, - color: Colors.white, - fontWeight: FontWeight.bold, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: width / 1.84, + height: height * 1 / 7, + child: Text( + widget.product!.text!, + style: const TextStyle( + fontSize: 30, + color: Colors.white, + fontWeight: FontWeight.bold, + ), ), ), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: const [ - Text( - 'YEAR', - style: TextStyle( - fontSize: 16, - color: Colors.white, - fontWeight: FontWeight.bold), - ), - Text( - '1561', - style: TextStyle( - fontSize: 22, - color: Colors.white, - fontWeight: FontWeight.bold), - ) - ], - ) - ], - ), - Text( - widget.product!.owner!, - style: const TextStyle( - fontWeight: FontWeight.bold, color: Colors.white), - ), - SizedBox( - height: height * 0.01, - ), - SizedBox( - width: width * 0.40, - // width: 100, - // height: 40, - child: Row( - children: [ Column( - children: [ + crossAxisAlignment: CrossAxisAlignment.end, + children: const [ Text( - 'height'.toUpperCase(), - overflow: TextOverflow.ellipsis, - style: const TextStyle( - // fontWeight: FontWeight.bold, + 'YEAR', + style: TextStyle( + fontSize: 16, color: Colors.white, - fontSize: 11), + fontWeight: FontWeight.bold), ), Text( - widget.product!.height.toString(), - overflow: TextOverflow.ellipsis, - style: const TextStyle( - fontWeight: FontWeight.bold, + '1561', + style: TextStyle( + fontSize: 22, color: Colors.white, - fontSize: 16), + fontWeight: FontWeight.bold), ) ], - ), - Expanded( - child: Column( + ) + ], + ), + Text( + widget.product!.owner!, + style: const TextStyle( + fontWeight: FontWeight.bold, color: Colors.white), + ), + SizedBox( + height: height * 0.01, + ), + SizedBox( + width: width * 0.40, + // width: 100, + // height: 40, + child: Row( + children: [ + Column( children: [ Text( - 'sold by'.toUpperCase(), + 'height'.toUpperCase(), overflow: TextOverflow.ellipsis, style: const TextStyle( // fontWeight: FontWeight.bold, @@ -164,7 +144,7 @@ class _ProductPageState extends State { fontSize: 11), ), Text( - widget.product!.seller!, + widget.product!.height.toString(), overflow: TextOverflow.ellipsis, style: const TextStyle( fontWeight: FontWeight.bold, @@ -173,147 +153,172 @@ class _ProductPageState extends State { ) ], ), - ) - ], + Expanded( + child: Column( + children: [ + Text( + 'sold by'.toUpperCase(), + overflow: TextOverflow.ellipsis, + style: const TextStyle( + // fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 11), + ), + Text( + widget.product!.seller!, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 16), + ) + ], + ), + ) + ], + ), + ), + SizedBox( + height: height * 0.02, ), - ), - SizedBox( - height: height * 0.02, - ), - RelicBazaarStackedView( - upperColor: Colors.white, - width: width * 0.32, - height: 35, - borderColor: Colors.white, - child: Center( - child: Text( - widget.product!.amount!, - style: const TextStyle( - fontWeight: FontWeight.bold, - color: RelicColors.primaryColor, - fontSize: 22), + RelicBazaarStackedView( + upperColor: Colors.white, + width: width * 0.32, + height: 35, + borderColor: Colors.white, + child: Center( + child: Text( + widget.product!.amount!, + style: const TextStyle( + fontWeight: FontWeight.bold, + color: RelicColors.primaryColor, + fontSize: 22), + ), ), ), - ), - SizedBox( - height: height * 0.025, - ), - SizedBox( - height: height * 0.55, - width: width, - child: Stack( - children: [ - RelicBazaarStackedView( - width: width * 0.9, - height: height * 0.54, - child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: height * 0.05, - ), - SizedBox( - width: width * 0.4, - child: const Text( - 'HISTORICAL SIGNIFICANCE', + SizedBox( + height: height * 0.025, + ), + SizedBox( + height: height * 0.68, + width: width, + child: Stack( + children: [ + RelicBazaarStackedView( + width: width * 0.9, + height: height * 0.68, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 20), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: height * 0.05, + ), + SizedBox( + width: width * 0.40, + child: const Text( + 'HISTORICAL SIGNIFICANCE', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white), + ), + ), + SizedBox( + height: height * .005, + ), + const Text( + 'A British Royal Doulton glazed stoneware antique with lovely shades of blue, grey and gold.', + style: TextStyle( + // fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white), + ), + SizedBox( + height: height * .02, + ), + const Text( + 'CONDITION', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white), ), - ), - SizedBox( - height: height * .005, - ), - const Text( - 'A British Royal Doulton glazed stoneware antique with lovely shades of blue, grey and gold.', - style: TextStyle( - // fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.white), - ), - SizedBox( - height: height * .02, - ), - const Text( - 'CONDITION', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.white), - ), - SizedBox( - height: height * .005, - ), - const Text( - 'Mild scratches and normal signs of wear and tear might be there. Still, All antiques must be handled with care,', - style: TextStyle( - // fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.white), - ), - SizedBox( - height: height * .025, - ), - Row( - children: [ - RelicBazaarStackedView( - upperColor: Colors.white, - width: width * 0.12, - height: height * 0.05, - borderColor: Colors.white, - child: const Icon( - Icons.favorite, - color: RelicColors.primaryColor, + SizedBox( + height: height * .005, + ), + const Text( + 'Mild scratches and normal signs of wear and tear might be there. Still, All antiques must be handled with care,', + style: TextStyle( + // fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white), + ), + SizedBox( + height: height * 0.020, + ), + Row( + children: [ + RelicBazaarStackedView( + upperColor: Colors.white, + width: width * 0.12, + height: height * 0.05, + borderColor: Colors.white, + child: const Icon( + Icons.favorite, + color: RelicColors.primaryColor, + ), ), - ), - SizedBox( - width: width * 0.02, - ), - RelicBazaarStackedView( - upperColor: Colors.white, - width: width * 0.35, - height: height * 0.05, - borderColor: Colors.white, - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - children: const [ - Icon( - Icons.add, - color: RelicColors.primaryColor, - ), - Text( - 'ADD TO CART', - style: TextStyle( - color: RelicColors - .primaryColor, - fontWeight: FontWeight.bold, - fontSize: 15), - ), - ], + SizedBox( + width: width * 0.02, ), - ) - ], - ) - ], - ), - )), - Transform.translate( - offset: const Offset(120, -180), - child: Image.asset( - widget.product!.image!, - width: 300, - height: 300, + RelicBazaarStackedView( + upperColor: Colors.white, + width: width * 0.40, + height: height * 0.05, + borderColor: Colors.white, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: const [ + Icon( + Icons.add, + color: + RelicColors.primaryColor, + ), + Text( + 'ADD TO CART', + style: TextStyle( + color: RelicColors + .primaryColor, + fontWeight: + FontWeight.bold, + fontSize: 15), + ), + ], + ), + ) + ], + ) + ], + ), + )), + Transform.translate( + offset: const Offset(120, -180), + child: Image.asset( + widget.product!.image!, + width: 300, + height: 300, + ), ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), diff --git a/lib/widgets/search_bar.dart b/lib/widgets/search_bar.dart index 4c5d498..9b9b5df 100644 --- a/lib/widgets/search_bar.dart +++ b/lib/widgets/search_bar.dart @@ -27,12 +27,15 @@ Widget searchBar(BuildContext context) { child: Row( // ignore: prefer_const_literals_to_create_immutables children: [ - const Text( - 'Search for categories, items ...', - style: TextStyle( - fontFamily: 'pix M 8pt', - fontSize: 18, - color: RelicColors.primaryBlack, + Container( + width: width * 0.7, + child: const Text( + 'Search for categories, items ...', + style: TextStyle( + fontFamily: 'pix M 8pt', + fontSize: 15, + color: RelicColors.primaryBlack, + fontWeight: FontWeight.w500), ), ), ],