import 'package:easycook_mobile/theme.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_svg/flutter_svg.dart';

class SemuaUlasanPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Semua Ulasan'),
        centerTitle: true,
        foregroundColor: Colors.black,
        backgroundColor: Colors.white,
        elevation: 0.5,
      ),
      body: Container(
        padding: EdgeInsets.only(top: 24, left: 16, right: 16),
        child: ListView(
          children: [
            // Tags
            Container(
              height: 23,
              padding: EdgeInsets.only(top: 24),
              child: ListView(
                scrollDirection: Axis.horizontal,
                children: [
                  Container(
                    width: 56,
                    height: 23,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(5),
                      border: Border.all(color: Colors.orange),
                    ),
                    child: Center(
                      child: Text(
                        'Semua Ulasan',
                        style: GoogleFonts.montserrat().copyWith(
                          fontSize: 12,
                          fontWeight: FontWeight.bold,
                          color: Colors.orange,
                        ),
                      ),
                    ),
                  ),
                ],
              ),
            ),
            // Komentar
            _komentar(),
            _komentar(),
            _komentar(),
            _komentar(),
            _komentar(),
            _komentar(),
          ],
        ),
      ),
    );
  }
}

_komentar() {
  return Padding(
    padding: const EdgeInsets.only(top: 26.5),
    child: Container(
      width: 328,
      height: 166,
      padding: const EdgeInsets.only(top: 16, left: 14, right: 16, bottom: 12),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(5),
        border: Border.all(color: Colors.orange),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            children: [
              Image.asset(
                'images/komentar_icon.png',
                width: 30,
                height: 30,
              ),
              SizedBox(
                width: 9,
              ),
              Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    'Rika Kusumawati',
                    style: GoogleFonts.montserrat().copyWith(
                      fontSize: 11,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                  Row(
                    children: [
                      SvgPicture.asset('assets/icons/Star 1.svg'),
                      SvgPicture.asset('assets/icons/Star 1.svg'),
                      SvgPicture.asset('assets/icons/Star 1.svg'),
                      SvgPicture.asset('assets/icons/Star 1.svg'),
                      SvgPicture.asset('assets/icons/Star 1.svg'),
                    ],
                  ),
                ],
              ),
              Spacer(),
              Text(
                '5 hari yang lalu',
                style: GoogleFonts.montserrat().copyWith(
                  fontSize: 10,
                  color: Colors.black38,
                ),
              ),
            ],
          ),
          Row(
            children: [
              SizedBox(
                width: 39,
                height: 30,
              ),
              Expanded(
                child: Text(
                  'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore ',
                  style: GoogleFonts.montserrat().copyWith(fontSize: 10),
                ),
              ),
            ],
          ),
          Row(
            children: [
              SizedBox(
                width: 39,
              ),
              Image.asset(
                'images/komentar.png',
                width: 56.5,
                height: 61,
              ),
              SizedBox(
                width: 9,
              ),
              Image.asset(
                'images/komentar.png',
                width: 56.5,
                height: 61,
              ),
            ],
          ),
        ],
      ),
    ),
  );
}
