Skip to content

Commit

Permalink
Fix expanded issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Zryte authored and Zryte committed Sep 24, 2024
1 parent 69905ce commit 9b8f782
Showing 1 changed file with 70 additions and 72 deletions.
142 changes: 70 additions & 72 deletions lib/core/widget/ad_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,89 +13,87 @@ class AdWidget extends StatelessWidget {
final themeData = Theme.of(context);
return Container(
padding: const EdgeInsets.all(16),
child: Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
AdvertiserRowWidget(
advertiserId: amityAd.advertiserId ?? '',
companyName: amityAd.advertiser?.companyName,
advertiserAvatar: amityAd.advertiser?.avatar),
Text(
'Ad id - ${amityAd.adId}',
style: themeData.textTheme.bodySmall,
),
Text(
'Target - ${amityAd.adTarget}',
style: themeData.textTheme.bodySmall,
),
Text(
'Placements - ${amityAd.placements}',
style: themeData.textTheme.bodySmall,
),
Text(
'Start at - ${amityAd.startAt ?? 'N/A'}',
style: themeData.textTheme.bodySmall,
),
Text(
'End at - ${amityAd.endAt ?? 'forever'}',
style: themeData.textTheme.bodySmall,
),
Text(
'Name - ${amityAd.name}',
style: themeData.textTheme.titleMedium,
),
Text(
'Headline - ${amityAd.headline ?? 'N/A - Headline is not available'}',
style: themeData.textTheme.titleLarge,
),
Text(
'Description - ${amityAd.description ?? 'N/A - Description is not available'}',
style: themeData.textTheme.bodyMedium,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
AdvertiserRowWidget(
advertiserId: amityAd.advertiserId ?? '',
companyName: amityAd.advertiser?.companyName,
advertiserAvatar: amityAd.advertiser?.avatar),
Text(
'Ad id - ${amityAd.adId}',
style: themeData.textTheme.bodySmall,
),
Text(
'Target - ${amityAd.adTarget}',
style: themeData.textTheme.bodySmall,
),
Text(
'Placements - ${amityAd.placements}',
style: themeData.textTheme.bodySmall,
),
Text(
'Start at - ${amityAd.startAt ?? 'N/A'}',
style: themeData.textTheme.bodySmall,
),
Text(
'End at - ${amityAd.endAt ?? 'forever'}',
style: themeData.textTheme.bodySmall,
),
Text(
'Name - ${amityAd.name}',
style: themeData.textTheme.titleMedium,
),
Text(
'Headline - ${amityAd.headline ?? 'N/A - Headline is not available'}',
style: themeData.textTheme.titleLarge,
),
Text(
'Description - ${amityAd.description ?? 'N/A - Description is not available'}',
style: themeData.textTheme.bodyMedium,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
margin: const EdgeInsets.all(4),
color: Colors.blueGrey.withOpacity(.25),
width: 130,
height: 130,
child: (amityAd.image1_1 != null)
? Image.network(
amityAd.image1_1!.getUrl(AmityImageSize.MEDIUM),
fit: BoxFit.cover,
)
: const Align(
alignment: Alignment.center,
child: Text(
"1:1 Ad image is not available",
textAlign: TextAlign.center,
),
),
),
Container(
margin: const EdgeInsets.all(4),
color: Colors.blueGrey.withOpacity(.25),
width: 130,
height: 130,
child: (amityAd.image1_1 != null)
child: (amityAd.image9_16 != null)
? Image.network(
amityAd.image1_1!.getUrl(AmityImageSize.MEDIUM),
fit: BoxFit.cover,
amityAd.image9_16!.getUrl(AmityImageSize.MEDIUM),
fit: BoxFit.fitWidth,
)
: const Align(
alignment: Alignment.center,
child: Text(
"1:1 Ad image is not available",
"9:16 Ad image is not available",
textAlign: TextAlign.center,
),
),
),
Container(
margin: const EdgeInsets.all(4),
color: Colors.blueGrey.withOpacity(.25),
width: 130,
height: 130,
child: (amityAd.image9_16 != null)
? Image.network(
amityAd.image9_16!.getUrl(AmityImageSize.MEDIUM),
fit: BoxFit.fitWidth,
)
: const Align(
alignment: Alignment.center,
child: Text(
"9:16 Ad image is not available",
textAlign: TextAlign.center,
),
))
]),
],
),
))
]),
],
),
);
}
Expand Down

0 comments on commit 9b8f782

Please sign in to comment.