@ -5,10 +5,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import ' package:google_fonts/google_fonts.dart ' ;
import ' package:google_fonts/google_fonts.dart ' ;
import ' package:gradient_borders/box_borders/gradient_box_border.dart ' ;
import ' package:gradient_borders/box_borders/gradient_box_border.dart ' ;
import ' package:text_scroll/text_scroll.dart ' ;
import ' package:text_scroll/text_scroll.dart ' ;
import ' package:zoom_tap_animation/zoom_tap_animation.dart ' ;
class PostComponent extends StatelessWidget {
class PostComponent extends StatelessWidget {
const PostComponent ( { Key ? key } ) : super ( key: key ) ;
final VoidCallback ? callback ;
const PostComponent ( { Key ? key , required this . callback } ) : super ( key: key ) ;
@ override
@ override
Widget build ( BuildContext context ) {
Widget build ( BuildContext context ) {
return SizedBox (
return SizedBox (
@ -60,56 +61,95 @@ class PostComponent extends StatelessWidget {
] ,
] ,
) ,
) ,
SizedBox ( height: 10 ) ,
SizedBox ( height: 10 ) ,
AspectRatio (
ZoomTapAnimation (
aspectRatio: 1 / 1 ,
onTap: callback ,
child: Container (
enableLongTapRepeatEvent: false ,
width: 300 ,
longTapRepeatDuration: const Duration ( milliseconds: 100 ) ,
height: 300 ,
begin: 1.0 ,
decoration: BoxDecoration (
end: 0.99 ,
/ / add border
beginDuration: const Duration ( milliseconds: 70 ) ,
border: const GradientBoxBorder (
endDuration: const Duration ( milliseconds: 100 ) ,
gradient: LinearGradient ( colors: [
beginCurve: Curves . decelerate ,
Colors . transparent ,
endCurve: Curves . easeInOutSine ,
Color ( 0xFF323232 ) ,
child: AspectRatio (
] , begin: Alignment . topCenter , end: Alignment . bottomCenter ) ,
aspectRatio: 1 / 1 ,
width: 2.5 ,
child: Container (
) ,
decoration: BoxDecoration (
/ / set border radius
/ / add border
borderRadius: BorderRadius . circular ( 20 ) ,
border: const GradientBoxBorder (
) ,
gradient: LinearGradient (
child: ClipRRect (
colors: [
borderRadius: BorderRadius . circular ( 18 ) ,
Colors . transparent ,
/ / implement image
Color ( 0xFF323232 ) ,
child: Stack (
] ,
alignment: Alignment . bottomCenter ,
begin: Alignment . topCenter ,
children: [
end: Alignment . bottomCenter ) ,
Image (
width: 2.5 ,
image: AssetImage ( " assets/images/exemple_cover.png " ) ,
fit: BoxFit . cover ,
width: double . infinity ,
) ,
) ,
Image (
/ / set border radius
image: AssetImage ( " assets/images/shadow_post.png " ) ,
borderRadius: BorderRadius . circular ( 20 ) ,
fit: BoxFit . fitHeight ,
) ,
width: double . infinity ,
child: ClipRRect (
borderRadius: BorderRadius . circular ( 18 ) ,
/ / implement image
child: Stack (
alignment: Alignment . bottomCenter ,
children: [
Image (
image: AssetImage ( " assets/images/exemple_cover.png " ) ,
fit: BoxFit . cover ,
width: double . infinity ,
) ,
Image (
image: AssetImage ( " assets/images/shadow_post.png " ) ,
fit: BoxFit . fitHeight ,
width: double . infinity ,
) ,
Padding (
padding: EdgeInsets . all ( 15 ) ,
child: AutoSizeText (
' “J’ écoute en boucle ce son. B2O<3” ' ,
style: GoogleFonts . plusJakartaSans (
color: Colors . white ,
fontWeight: FontWeight . w400 ,
fontSize: 15. sp ) ,
maxFontSize: 20 ,
maxLines: 1 ,
) ,
) ,
Positioned (
top: 0 ,
right: 0 ,
child: Padding (
padding: EdgeInsets . all ( 12 ) ,
child: Container (
constraints: BoxConstraints (
maxWidth: 140 , maxHeight: 140 ) ,
width: 80. sp ,
height: 80. sp ,
decoration: BoxDecoration (
color: Colors . white ,
/ / add border
border:
Border . all ( width: 3 , color: Colors . white ) ,
/ / set border radius
borderRadius: BorderRadius . circular ( 15 ) ,
) ,
child: ClipRRect (
borderRadius: BorderRadius . circular ( 13 ) ,
/ / implement image
child: Image . network (
' assets/images/exemple_profile.png ' ,
fit: BoxFit . cover ,
) ,
) ,
) ,
) )
] ,
) ,
) ,
Padding (
) ,
padding: EdgeInsets . all ( 15 ) ,
child: AutoSizeText (
' “J’ écoute en boucle ce son. B2O<3” ' ,
style: GoogleFonts . plusJakartaSans (
color: Colors . white ,
fontWeight: FontWeight . w400 ,
fontSize: 15. sp ) ,
maxFontSize: 20 ,
maxLines: 1 ,
) ,
)
] ,
) ,
) ,
) ,
) ) ,
) ,
) ,
SizedBox ( height: 10 ) ,
SizedBox ( height: 10 ) ,
Row (
Row (
crossAxisAlignment: CrossAxisAlignment . end ,
crossAxisAlignment: CrossAxisAlignment . end ,
@ -166,7 +206,6 @@ class PostComponent extends StatelessWidget {
) ,
) ,
] ,
] ,
) ,
) ,
SizedBox ( height: 60 ) ,
] ,
] ,
) ,
) ,
) ;
) ;