add icon
continuous-integration/drone/push Build is passing Details

PROFIL_PAGE_LDE
Lucas Delanier 2 years ago
parent eb551aefa9
commit cff55c26ee

@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.justmusic">
<application
android:label="justmusic"
android:label="JustMUSIC"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">

@ -44,7 +44,7 @@ class _ButtonPlayComponentState extends State<ButtonPlayComponent> {
child: Icon(
isPlaying ? Icons.pause_circle : Icons.play_circle,
color: Colors.white,
size: 53,
size: 45,
),
));
}

@ -41,189 +41,7 @@ class _PostComponentState extends State<PostComponent> with TickerProviderStateM
Widget build(BuildContext context) {
return GestureDetector(
onTap: switchChoice,
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
if (widget.callback == null) {
return SizedBox(
width: double.infinity,
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
ProfilPictureComponent(user: widget.post.user),
Expanded(
flex: 8,
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.post.user.pseudo,
style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600),
),
widget.post.location.item2 != null
? Text(
"${widget.post.location.item1}, ${widget.post.location.item2}",
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.4),
fontWeight: FontWeight.w300,
fontSize: 13),
)
: Text(
"",
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.4),
fontWeight: FontWeight.w300,
fontSize: 13),
)
],
),
),
),
DateTime(today.year, today.month, today.day).isAtSameMomentAs(
DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day))
? Text(
"Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}",
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13),
)
: Text(
"${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}",
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13),
),
],
),
SizedBox(height: 10),
ZoomTapAnimation(
onTap: () {
if (widget.post.selfie != null) {
switchChoice();
}
},
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,
),
// set border radius
borderRadius: BorderRadius.circular(20),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(18),
// implement image
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Image(
image: NetworkImage(choice ? widget.post.selfie! : widget.post.music.cover!),
fit: BoxFit.cover,
width: double.infinity,
),
widget.post.selfie != null
? Positioned(
top: 0,
right: 0,
child: Padding(
padding: EdgeInsets.all(12),
child: Container(
constraints: BoxConstraints(maxWidth: 140, maxHeight: 140),
width: 90.sp,
height: 90.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(
image: NetworkImage(
choice ? widget.post.music.cover! : widget.post.selfie!),
fit: BoxFit.cover,
),
),
),
))
: Container(),
],
),
),
),
)),
SizedBox(height: 15),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
flex: 8,
child: TextScroll(
widget.post.music.artists.first.name!,
style: GoogleFonts.plusJakartaSans(
height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
)),
Padding(
padding: EdgeInsets.only(bottom: 10.h, right: 5.w, left: 5.w),
child: ClipOval(
child: Container(
width: 5.h,
height: 5.h,
color: Colors.white,
),
),
),
Expanded(
flex: 8,
child: Padding(
padding: EdgeInsets.only(bottom: 2),
child: TextScroll(
widget.post.music.title!,
style: GoogleFonts.plusJakartaSans(
height: 1, color: Colors.white, fontWeight: FontWeight.w300, fontSize: 16.h),
mode: TextScrollMode.endless,
velocity: Velocity(pixelsPerSecond: Offset(50, 20)),
pauseBetween: Duration(milliseconds: 500),
),
)),
Container(width: 10),
AutoSizeText(
widget.post.music.date.toString(),
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, fontSize: 16.h),
textAlign: TextAlign.end,
maxFontSize: 20,
),
],
),
],
));
}
return SizedBox(
child: SizedBox(
width: double.infinity,
child: Column(
children: [
@ -366,9 +184,7 @@ class _PostComponentState extends State<PostComponent> with TickerProviderStateM
),
)),
SizedBox(height: 15),
SizedBox(
height: 40,
child: Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
@ -398,26 +214,17 @@ class _PostComponentState extends State<PostComponent> with TickerProviderStateM
),
],
),
Expanded(
flex: 8,
child: TextScroll(
TextScroll(
widget.post.music.artists.first.name!,
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white.withOpacity(0.5),
fontWeight: FontWeight.w300,
fontSize: 16.h),
height: 1, color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, fontSize: 16.h),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
)),
],
),
)
],
));
},
),
);
],
)));
}
}

@ -1,6 +1,7 @@
import 'package:flutter/Material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:justmusic/components/profil_picture_component.dart';
import '../main.dart';
import '../model/User.dart';
import '../values/constants.dart';
@ -23,13 +24,7 @@ class _ProfileListComponentState extends State<ProfileListComponent> {
padding: const EdgeInsets.only(bottom: 5),
child: Row(
children: [
ClipOval(
child: FadeInImage.assetNetwork(
height: 50,
width: 50,
fit: BoxFit.cover,
placeholder: "assets/images/loadingPlaceholder.gif",
image: widget.user.pp)),
ProfilPictureComponent(user: widget.user),
const SizedBox(
width: 10,
),

@ -9,6 +9,7 @@ import 'package:text_scroll/text_scroll.dart';
import 'package:zoom_tap_animation/zoom_tap_animation.dart';
import '../components/button_play_component.dart';
import '../components/comment_component.dart';
import '../components/profil_picture_component.dart';
import '../main.dart';
import '../model/Post.dart';
import '../model/Comment.dart';
@ -115,10 +116,7 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
child: ClipOval(
child: SizedBox.fromSize(
// Image radius
child: Image(
image: NetworkImage(widget.post.user.pp),
width: 45,
),
child: ProfilPictureComponent(user: widget.post.user),
),
),
)
@ -146,13 +144,9 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
fontWeight: FontWeight.w800,
fontSize: 22,
),
mode: TextScrollMode
.endless,
pauseBetween: Duration(
milliseconds: 500),
velocity: Velocity(
pixelsPerSecond:
Offset(20, 0)),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
),
),
),
@ -445,7 +439,7 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
focusNode: myFocusNode,
onSubmitted: (value) async {
if (value.isNotEmpty) {
await MyApp.commentViewModel.addComment(value, widget.post.id);
await MyApp.commentViewModel.addComment(value, widget.post.id, widget.post.user);
}
setState(() {
_textController.clear();
@ -455,11 +449,13 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
keyboardType: TextInputType.emailAddress,
style: GoogleFonts.plusJakartaSans(color: Colors.white),
decoration: InputDecoration(
suffixIcon: Icon(
suffixIcon: IconButton(
onPressed: () {},
icon: Icon(
Icons.send,
color: grayText,
size: 20,
),
)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(width: 1, color: grayText),
borderRadius: BorderRadius.all(Radius.circular(100)),
@ -491,8 +487,7 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
class MyBehavior extends ScrollBehavior {
@override
Widget buildOverscrollIndicator(
BuildContext context, Widget child, ScrollableDetails details) {
Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) {
return child;
}
}

@ -56,6 +56,7 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
@override
void dispose() {
controller.dispose();
animationController.dispose();
super.dispose();
}
@ -120,7 +121,7 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
bool empty =
(choiceFeed == true && displayFeed.item1.isEmpty) || (choiceFeed == false && displayFeed.item2.isEmpty);
return Scaffold(
resizeToAvoidBottomInset: true,
resizeToAvoidBottomInset: false,
backgroundColor: bgColor,
extendBodyBehindAppBar: true,
body: Container(

@ -1,19 +1,24 @@
import 'package:justmusic/model/mapper/CommentMapper.dart';
import '../model/Comment.dart';
import '../model/User.dart';
import '../services/CommentService.dart';
import '../services/NotificationService.dart';
class CommentViewModel {
List<Comment> _comments = [];
final CommentService _commentService = CommentService();
final NotificationService _notificationService = NotificationService();
// Constructor
CommentViewModel();
// Methods
addComment(String text, String idPost) async {
addComment(String text, String idPost, User receiver) async {
try {
print(receiver.token);
await _commentService.createComment(text, idPost);
_notificationService.sendNotifyComment(receiver.token, text);
} catch (e) {
print(e);
rethrow;

Loading…
Cancel
Save