Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overflow in many places #257

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
3 changes: 2 additions & 1 deletion lib/helpers/ad_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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}'),
);
}
36 changes: 23 additions & 13 deletions lib/widgets/product/product_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProductCard> createState() => _ProductCardState();
}

class _ProductCardState extends State<ProductCard> {
@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(
Expand All @@ -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(
boxShadow: <BoxShadow>[
const BoxShadow(
color: RelicColors.secondaryBlack,
offset: Offset(0, 3),
blurRadius: 6,
Expand All @@ -36,7 +43,7 @@ class ProductCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
product!.text!,
widget.product!.text!,
style: const TextStyle(
fontSize: 18,
color: Colors.white,
Expand All @@ -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,
Expand All @@ -59,7 +66,7 @@ class ProductCard extends StatelessWidget {
height: 20,
),
Text(
product!.amount!,
widget.product!.amount!,
style: const TextStyle(
fontSize: 18,
color: Colors.white,
Expand All @@ -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,
),
),
)
],
Expand Down
Loading