@ -5,10 +5,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import ' package:google_fonts/google_fonts.dart ' ;
import ' package:gradient_borders/box_borders/gradient_box_border.dart ' ;
import ' package:text_scroll/text_scroll.dart ' ;
import ' package:zoom_tap_animation/zoom_tap_animation.dart ' ;
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
Widget build ( BuildContext context ) {
return SizedBox (
@ -60,56 +61,95 @@ class PostComponent extends StatelessWidget {
] ,
) ,
SizedBox ( height: 10 ) ,
AspectRatio (
aspectRatio: 1 / 1 ,
child: Container (
width: 300 ,
height: 300 ,
decoration: BoxDecoration (
/ / add border
border: const GradientBoxBorder (
gradient: LinearGradient ( colors: [
Colors . transparent ,
Color ( 0xFF323232 ) ,
] , begin: Alignment . topCenter , end: Alignment . bottomCenter ) ,
width: 2.5 ,
) ,
/ / set border radius
borderRadius: BorderRadius . circular ( 20 ) ,
) ,
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 ,
ZoomTapAnimation (
onTap: callback ,
enableLongTapRepeatEvent: false ,
longTapRepeatDuration: const Duration ( milliseconds: 100 ) ,
begin: 1.0 ,
end: 0.99 ,
beginDuration: const Duration ( milliseconds: 70 ) ,
endDuration: const Duration ( milliseconds: 100 ) ,
beginCurve: Curves . decelerate ,
endCurve: Curves . easeInOutSine ,
child: AspectRatio (
aspectRatio: 1 / 1 ,
child: Container (
decoration: BoxDecoration (
/ / add border
border: const GradientBoxBorder (
gradient: LinearGradient (
colors: [
Colors . transparent ,
Color ( 0xFF323232 ) ,
] ,
begin: Alignment . topCenter ,
end: Alignment . bottomCenter ) ,
width: 2.5 ,
) ,
Image (
image: AssetImage ( " assets/images/shadow_post.png " ) ,
fit: BoxFit . fitHeight ,
width: double . infinity ,
/ / set border radius
borderRadius: BorderRadius . circular ( 20 ) ,
) ,
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 ) ,
Row (
crossAxisAlignment: CrossAxisAlignment . end ,
@ -166,7 +206,6 @@ class PostComponent extends StatelessWidget {
) ,
] ,
) ,
SizedBox ( height: 60 ) ,
] ,
) ,
) ;