-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
122cdc9
commit 3fe0c02
Showing
5 changed files
with
117 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
application/lib/presentation/discovery_card/widget/custom_card/ad_card.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:xayn_design/xayn_design.dart'; | ||
import 'package:xayn_discovery_app/presentation/constants/r.dart'; | ||
import 'package:xayn_discovery_app/presentation/images/widget/cached_image.dart'; | ||
import 'package:xayn_discovery_app/presentation/images/widget/shader/shader.dart'; | ||
import 'package:xayn_discovery_app/presentation/images/widget/shader/static/static_painter.dart'; | ||
import 'package:xayn_discovery_app/presentation/widget/animation_player.dart'; | ||
|
||
class AdCard extends StatelessWidget { | ||
late final ShaderBuilder primaryCardShader = | ||
ShaderFactory.fromType(ShaderType.static); | ||
final VoidCallback onPressed; | ||
|
||
AdCard({ | ||
Key? key, | ||
required this.onPressed, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final children = <Widget>[ | ||
SizedBox(height: R.dimen.unit), | ||
Expanded(child: _buildAnimation()), | ||
SizedBox(height: R.dimen.unit2), | ||
Text( | ||
'Buy buy buy!', | ||
textAlign: TextAlign.center, | ||
style: R.styles.lBoldStyle.copyWith(color: R.colors.brightText), | ||
), | ||
SizedBox(height: R.dimen.unit2), | ||
Text( | ||
'click this ad for great success!!', | ||
textAlign: TextAlign.center, | ||
style: R.styles.mStyle.copyWith(color: R.colors.brightText), | ||
), | ||
SizedBox(height: R.dimen.unit2_5), | ||
_buildTakeSurveyBtn(), | ||
]; | ||
|
||
return Stack( | ||
children: [ | ||
Positioned.fill( | ||
child: CustomPaint( | ||
painter: StaticPainter( | ||
shadowColor: R.colors.shadow, | ||
), | ||
), | ||
), | ||
Padding( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: R.dimen.unit4, | ||
vertical: R.dimen.unit6, | ||
), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: children, | ||
), | ||
), | ||
], | ||
); | ||
} | ||
|
||
Widget _buildAnimation() => | ||
AnimationPlayer.assetUnrestrictedSize(R.assets.lottie.bookmarkClick); | ||
|
||
Widget _buildTakeSurveyBtn() => SizedBox( | ||
width: double.maxFinite, | ||
child: AppRaisedButton.text( | ||
text: 'OMG I WANT THIS NOW!!!', | ||
onPressed: onPressed, | ||
), | ||
); | ||
} |
11 changes: 3 additions & 8 deletions
11
application/lib/presentation/discovery_card/widget/custom_card/survey_card.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters