Commit a64e1bd3 authored by Daniel Tefr's avatar Daniel Tefr
Browse files

Merge remote-tracking branch 'refs/remotes/origin/master' into user-profile

# Conflicts:
#	lib/dashBoard/songPost/song_post.dart
#	lib/dashBoard/songPost/song_post_detail_page.dart
#	lib/home_page.dart
parents 20fc2fd6 dc95c1fe
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -9,9 +9,21 @@ class AddSongPostPage extends StatelessWidget {
  Widget build(BuildContext context) {
    return PageTemplate(
      title: "Add Song",
      body: Center(
      body: Container(
        decoration: BoxDecoration(
          gradient: LinearGradient(
            colors: [
              Theme.of(context).primaryColor,
              Theme.of(context).cardColor,
            ],
            begin: Alignment.topLeft,
            end: Alignment.bottomRight,
          ),
        ),
        child: Center(
          child: AddSongPost(),
        ),
      ),
    );
  }
}
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ class PageTemplate extends StatelessWidget {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).cardColor,
        title: Text(title),
        actions: [actions ?? const SizedBox()],
      ),
+2 −2
Original line number Diff line number Diff line
@@ -22,10 +22,10 @@ class DashBoardPage extends StatelessWidget {
        decoration: BoxDecoration(
          gradient: LinearGradient(
            colors: [
              Theme.of(context).primaryColor,
              Theme.of(context).cardColor,
              Theme.of(context).primaryColor,
            ],
            begin: Alignment.topLeft,
            begin: Alignment.topCenter,
            end: Alignment.bottomRight,
          ),
        ),
+3 −9
Original line number Diff line number Diff line
@@ -44,14 +44,14 @@ class FilterBar extends StatelessWidget {
                      showLikedOnly ? Icons.favorite : Icons.favorite_border,
                      color: showLikedOnly
                          ? Colors.white
                          : Colors.white.withOpacity(0.6),
                          : Colors.white.withOpacity(0.8),
                    ),
                    label: Text(
                      "Liked",
                      style: TextStyle(
                        color: showLikedOnly
                            ? Colors.white
                            : Colors.white.withOpacity(0.6),
                            : Colors.white.withOpacity(0.8),
                      ),
                    ),
                  ),
@@ -65,12 +65,6 @@ class FilterBar extends StatelessWidget {
                        backgroundColor: isSelected
                            ? Theme.of(context).primaryColor
                            : Theme.of(context).primaryColor.withOpacity(0.1),
                        side: BorderSide(
                          color: isSelected
                              ? Theme.of(context).primaryColor
                              : Theme.of(context).primaryColor.withOpacity(0.1),
                          width: 2.0,
                        ),
                      ),
                      onPressed: () {
                        filterService.toggleGenre(genre);
@@ -80,7 +74,7 @@ class FilterBar extends StatelessWidget {
                        style: TextStyle(
                          color: isSelected
                              ? Colors.white
                              : Colors.white.withOpacity(0.6),
                              : Colors.white.withOpacity(0.8),
                        ),
                      ),
                    ),
+28 −11
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:harmonis/userInteraction/model/comment_DTO.dart';
import '../../common/text_input_field.dart';

class SongComment extends StatelessWidget {
class SongComment extends StatefulWidget {
  final CommentDTO comment;
  final bool expanded;
  final VoidCallback onExpand;
@@ -18,9 +18,26 @@ class SongComment extends StatelessWidget {
  });

  @override
  Widget build(BuildContext context) {
    final TextEditingController replyController = TextEditingController();
  State<SongComment> createState() => _SongCommentState();
}

class _SongCommentState extends State<SongComment> {
  late TextEditingController replyController;

  @override
  void initState() {
    super.initState();
    replyController = TextEditingController();
  }

  @override
  void dispose() {
    replyController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Card(
      margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
      elevation: 2,
@@ -42,14 +59,14 @@ class SongComment extends StatelessWidget {
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        comment.author.name,
                        widget.comment.author.name,
                        style: Theme.of(context)
                            .textTheme
                            .bodyLarge
                            ?.copyWith(fontWeight: FontWeight.bold),
                      ),
                      Text(
                        '${comment.timeStamp.hour.toString().padLeft(2, '0')}:${comment.timeStamp.minute.toString().padLeft(2, '0')} on ${comment.timeStamp.day}/${comment.timeStamp.month}/${comment.timeStamp.year}',
                        '${widget.comment.timeStamp.hour.toString().padLeft(2, '0')}:${widget.comment.timeStamp.minute.toString().padLeft(2, '0')} on ${widget.comment.timeStamp.day}/${widget.comment.timeStamp.month}/${widget.comment.timeStamp.year}',
                        style: Theme.of(context)
                            .textTheme
                            .bodySmall
@@ -60,21 +77,21 @@ class SongComment extends StatelessWidget {
                ),
                IconButton(
                  icon: Icon(
                    expanded ? Icons.expand_less : Icons.expand_more,
                    widget.expanded ? Icons.expand_less : Icons.expand_more,
                    color: Theme.of(context).primaryColor,
                  ),
                  onPressed: onExpand,
                  onPressed: widget.onExpand,
                ),
              ],
            ),
            const SizedBox(height: 8),
            Text(
              comment.text,
              widget.comment.text,
              style: Theme.of(context).textTheme.bodyLarge,
            ),
            if (expanded) ...[
            if (widget.expanded) ...[
              const Divider(),
              for (CommentDTO reply in comment.replies)
              for (CommentDTO reply in widget.comment.replies)
                Padding(
                  padding: const EdgeInsets.only(bottom: 8.0),
                  child: Row(
@@ -98,7 +115,7 @@ class SongComment extends StatelessWidget {
                onSend: () {
                  final reply = replyController.text.trim();
                  if (reply.isNotEmpty) {
                    onReply(reply);
                    widget.onReply(reply);
                    replyController.clear();
                  }
                },
Loading