|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
|
import 'package:pinch_zoom/pinch_zoom.dart';
|
|
|
|
|
import 'package:text_scroll/text_scroll.dart';
|
|
|
|
|
import 'package:zoom_tap_animation/zoom_tap_animation.dart';
|
|
|
|
|
import '../components/button_play_component.dart';
|
|
|
|
@ -89,26 +90,35 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 400,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: PinchZoom(
|
|
|
|
|
resetDuration: const Duration(milliseconds: 400),
|
|
|
|
|
maxScale: 2.5,
|
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
|
placeholder: "assets/images/loadingPlaceholder.gif",
|
|
|
|
|
image: choice ? widget.post.selfie! : widget.post.music.cover!,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
IgnorePointer(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 200,
|
|
|
|
|
margin: EdgeInsets.only(top: 230),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
|
colors: [Colors.transparent, bgModal],
|
|
|
|
|
stops: [0, 0.8],
|
|
|
|
|
colors: [
|
|
|
|
|
Colors.transparent,
|
|
|
|
|
bgModal.withOpacity(0.5),
|
|
|
|
|
bgModal.withOpacity(0.75),
|
|
|
|
|
bgModal
|
|
|
|
|
],
|
|
|
|
|
stops: [0, 0.2, 0.4, 0.8],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
@ -240,6 +250,7 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
widget.post.description != null
|
|
|
|
|
? Align(
|
|
|
|
|
alignment: Alignment.bottomLeft,
|
|
|
|
@ -289,8 +300,52 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
|
|
|
|
|
SvgPicture.asset("assets/images/add.svg",
|
|
|
|
|
semanticsLabel: 'Add playlist Logo'),
|
|
|
|
|
GestureDetector(
|
|
|
|
|
onTap: () {
|
|
|
|
|
MyApp.musicViewModel.
|
|
|
|
|
onTap: () async {
|
|
|
|
|
var bool = await MyApp.musicViewModel
|
|
|
|
|
.addOrDeleteFavoriteMusic(widget.post.music.id);
|
|
|
|
|
!bool
|
|
|
|
|
? ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
|
SnackBar(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius:
|
|
|
|
|
new BorderRadius.all(new Radius.circular(300.0)),
|
|
|
|
|
),
|
|
|
|
|
behavior: SnackBarBehavior.floating,
|
|
|
|
|
content: Text(
|
|
|
|
|
"${widget.post.music.title} ajouté à votre collection",
|
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: primaryColor,
|
|
|
|
|
closeIconColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
|
SnackBar(
|
|
|
|
|
behavior: SnackBarBehavior.floating,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius:
|
|
|
|
|
new BorderRadius.all(new Radius.circular(300.0)),
|
|
|
|
|
),
|
|
|
|
|
content: Text(
|
|
|
|
|
"${widget.post.music.title} retiré de votre collection",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15),
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
|
closeIconColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: SvgPicture.asset("assets/images/save.svg",
|
|
|
|
|
semanticsLabel: 'Save Logo')),
|
|
|
|
|