import 'package:feelverapp/util/SizeConfig.dart';
import 'package:feelverapp/util/rating_star.dart';
import 'package:flutter/material.dart';

class ShopReviewsPage extends StatefulWidget {
  @override
  _ShopReviewsPageState createState() => _ShopReviewsPageState();
}

class _ShopReviewsPageState extends State<ShopReviewsPage> {
  double rate1 = 0;

  @override
  Widget build(BuildContext context) {
    SizeConfig(context);
    return Container(
      child: ListView(
        children: <Widget>[
          Column(
            children: <Widget>[
              Texttop(),
              Card1(),
            ],
          ),
        ],
      ),
    );
  }

  Widget Texttop() {
    return Container(
      margin: EdgeInsets.only(
          right: SizeConfig.getPadding(16),
          left: SizeConfig.getPadding(16),
          top: SizeConfig.getPadding(10),
          bottom: SizeConfig.getPadding(10)),
      child: SingleChildScrollView(
        child: Row(
          children: <Widget>[
            Text(
              'รีวิว(จากผู้ใช้บริการจริง)',
              style: TextStyle(
                color: Color(0xFF6AB3AA),
                fontSize: SizeConfig.getFontSize(14),
              ),
            ),
            Spacer(),
            Text(
              'ดูทั้งหมด',
              style: TextStyle(
                color: Colors.black,
                fontSize: SizeConfig.getFontSize(14),
              ),
            ),
          ],
        ),
      ),
    );
  }

  Widget Card1() {
    return Card(
      margin: EdgeInsets.only(
          right: SizeConfig.getPadding(16),
          left: SizeConfig.getPadding(16),
          top: SizeConfig.getPadding(20),
          bottom: SizeConfig.getPadding(10)),
      child: Container(
        margin: EdgeInsets.only(
          right: SizeConfig.getPadding(15),
          left: SizeConfig.getPadding(15),
          bottom: SizeConfig.getPadding(20),
          top: SizeConfig.getPadding(20),
        ),
//        color: Colors.blueGrey,
        child: Column(
          children: <Widget>[
            Container(
//              color: Colors.green,
              child: Column(
                children: <Widget>[
                  Row(
                    children: <Widget>[
                      Text(
                        '4.4',
                        style: TextStyle(
                          fontSize: SizeConfig.getFontSize(16),
                          color: Color(0xFFD5D5D5),
                        ),
                      ),
                      SizedBox(
                        width: SizeConfig.getWidth(8),
                      ),
                      RatingStar(
                        isRating: true,
                        rate: rate1,
                        starSize: 20,
                        onChangeRate: (i) {
                          setState(() {
                            rate1 = i;
                            print(i);
                          });
                        },
                      ),
                      SizedBox(
                        width: SizeConfig.getWidth(8),
                      ),
                      Text(
                        '(221)',
                        style: TextStyle(
                          fontSize: SizeConfig.getFontSize(16),
                          color: Color(0xFFD5D5D5),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: SizeConfig.getHeight(35),
                  ),
                  Row(
                    children: <Widget>[
                      Text(
                        'คุ้มค่า',
                        style: TextStyle(
                            fontSize: SizeConfig.getFontSize(16),
                            color: Colors.black),
                      ),
                      Spacer(),
                      RatingStar(
                        isRating: true,
                        rate: rate1,
                        starSize: 20,
                        onChangeRate: (i) {
                          setState(() {
                            rate1 = i;
                            print(i);
                          });
                        },
                      ),
                    ],
                  ),
                  SizedBox(
                    height: SizeConfig.getHeight(15),
                  ),
                  Row(
                    children: <Widget>[
                      Text(
                        'บรรยากาศดี',
                        style: TextStyle(
                            fontSize: SizeConfig.getFontSize(16),
                            color: Colors.black),
                      ),
                      Spacer(),
                      RatingStar(
                        isRating: true,
                        rate: rate1,
                        starSize: 20,
                        onChangeRate: (i) {
                          setState(() {
                            rate1 = i;
                            print(i);
                          });
                        },
                      ),
                    ],
                  ),
                  SizedBox(
                    height: SizeConfig.getHeight(15),
                  ),
                  Row(
                    children: <Widget>[
                      Text(
                        'บริการเยี่ยม',
                        style: TextStyle(
                            fontSize: SizeConfig.getFontSize(16),
                            color: Colors.black),
                      ),
                      Spacer(),
                      RatingStar(
                        isRating: true,
                        rate: rate1,
                        starSize: 20,
                        onChangeRate: (i) {
                          setState(() {
                            rate1 = i;
                            print(i);
                          });
                        },
                      ),
                    ],
                  ),
                  SizedBox(
                    height: SizeConfig.getHeight(15),
                  ),
                  Row(
                    children: <Widget>[
                      Text(
                        'สะอาด',
                        style: TextStyle(
                            fontSize: SizeConfig.getFontSize(16),
                            color: Colors.black),
                      ),
                      Spacer(),
                      RatingStar(
                        isRating: true,
                        rate: rate1,
                        starSize: 20,
                        onChangeRate: (i) {
                          setState(() {
                            rate1 = i;
                            print(i);
                          });
                        },
                      ),
                    ],
                  ),
                  SizedBox(
                    height: SizeConfig.getHeight(15),
                  ),
                ],
              ),
            ),
            Divider(
              color: Color(0xFF606060),
            ),
            Container(
//              color: Colors.deepPurpleAccent,
              child: Row(
                children: <Widget>[
                  ClipRRect(
                    borderRadius: BorderRadius.circular(50),
                    child: Image.asset(
                      'assets/images/ic_userimg.png',
                      width: 55.0,
                      height: 55.0,
                      fit: BoxFit.cover,
                    ),
                  ),
                  SizedBox(
                    width: SizeConfig.getWidth(10),
                  ),
                  Expanded(
                    child: Container(
//                      color: Colors.green,
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: <Widget>[
                          SingleChildScrollView(
                            child: Row(
                              children: <Widget>[
                                Text(
                                  'Rattaya Pratumkan',
                                  style: TextStyle(
                                      fontSize: SizeConfig.getFontSize(20),
                                      color: Colors.black),
                                ),
                                Spacer(),
                                Container(
                                  child: Icon(Icons.more_vert),
                                )
                              ],
                            ),
                          ),
                          SizedBox(
                            height: SizeConfig.getHeight(5),
                          ),
                          Container(
//                            color: Colors.blue,
                            child: Row(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: <Widget>[
                                RatingStar(
                                  isRating: true,
                                  rate: rate1,
                                  starSize: 20,
                                  onChangeRate: (i) {
                                    setState(() {
                                      rate1 = i;
                                      print(i);
                                    });
                                  },
                                ),
                              ],
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
            Container(
//              color: Colors.blue,
              child: Column(
                children: <Widget>[
                  Padding(
                    padding: const EdgeInsets.only(
                        top: 10, bottom: 10, left: 2, right: 2),
                    child: Text(
                      'การบริการและบรรยากาศดีมาก มีห้องอาบน้ำพร้อมผ้าเช็ดตัว สบู่ ครีมสระผม พนักงานดูแลเอาใจใส่ และคอยแนะนำตลอดจนถึง therapist มีความเป็นมืออาชีพให้ความผ่อนคลายแก่ลูกค้า',
                      style: TextStyle(
                        fontSize: SizeConfig.getFontSize(12),
                      ),
                    ),
                  ),
                  Row(
                    children: <Widget>[
                      RaisedButton(
                        color: Color(0xFF3694A3),
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(20),
                        ),
                        onPressed: () {},
                        child: Text(
                          "บริการดีมาก",
                          style: TextStyle(
                            color: Colors.white,
                          ),
                        ),
                      ),
                      SizedBox(
                        width: SizeConfig.getWidth(14),
                      ),
                      RaisedButton(
                        color: Color(0xFF3694A3),
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(20),
                        ),
                        onPressed: () {},
                        child: Padding(
                          padding: const EdgeInsets.only(
                            right: 10,
                            left: 10,
                          ),
                          child: Text(
                            "คุ้มค่าดี",
                            style: TextStyle(
                              color: Colors.white,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: SizeConfig.getHeight(10),
                  ),
                ],
              ),
            ),
            Container(
              color: Color(0xFFF2F2F2),
              child: Padding(
                padding: const EdgeInsets.only(
                  left: 30,
                  top: 20,
                  bottom: 20,
                ),
                child: Row(
                  children: <Widget>[
                    ClipRRect(
                      borderRadius: BorderRadius.circular(10),
                      child: Image.asset(
                        "assets/images/demo_img.png",
                        width: 100.0,
                        height: 90.0,
                        fit: BoxFit.cover,
                      ),
                    ),
                    SizedBox(
                      width: SizeConfig.getWidth(10),
                    ),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        Text(
                          'service : Spa Cenvaree',
                          style: TextStyle(
                              fontSize: SizeConfig.getFontSize(14),
                              color: Colors.black),
                        ),
                        Text(
                          "Ladies' Day",
                          style: TextStyle(
                              fontSize: SizeConfig.getFontSize(14),
                              color: Colors.black),
                        ),
                        SizedBox(
                          height: SizeConfig.getHeight(5),
                        ),
                        Text(
                          "03/16/2019 12:49",
                          style: TextStyle(
                            fontSize: SizeConfig.getFontSize(14),
                            color: Color(0xFF6AB3AA),
                          ),
                        ),
                        SizedBox(
                          height: SizeConfig.getHeight(9),
                        ),
                        Row(
                          children: <Widget>[
                            Icon(
                              Icons.access_time,
                              color: Color(0xFFEEAFB7),
                            ),
                            Text(' 150Min')
                          ],
                        )
                      ],
                    ),
                  ],
                ),
              ),
            ),
            SizedBox(
              height: SizeConfig.getHeight(30),
            ),
            Container(
//              color: Colors.deepPurpleAccent,
              child: Row(
                children: <Widget>[
                  ClipRRect(
                    borderRadius: BorderRadius.circular(50),
                    child: Image.asset(
                      'assets/images/ic_userimg.png',
                      width: 55.0,
                      height: 55.0,
                      fit: BoxFit.cover,
                    ),
                  ),
                  SizedBox(
                    width: SizeConfig.getWidth(10),
                  ),
                  Expanded(
                    child: Container(
//                      color: Colors.green,
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: <Widget>[
                          SingleChildScrollView(
                            child: Row(
                              children: <Widget>[
                                Text(
                                  'Rattaya Pratumkan',
                                  style: TextStyle(
                                      fontSize: SizeConfig.getFontSize(20),
                                      color: Colors.black),
                                ),
                                Spacer(),
                                Container(
                                  child: Icon(Icons.more_vert),
                                )
                              ],
                            ),
                          ),
                          SizedBox(
                            height: SizeConfig.getHeight(5),
                          ),
                          Container(
//                            color: Colors.blue,
                            child: Row(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: <Widget>[
                                RatingStar(
                                  isRating: true,
                                  rate: rate1,
                                  starSize: 20,
                                  onChangeRate: (i) {
                                    setState(() {
                                      rate1 = i;
                                      print(i);
                                    });
                                  },
                                ),
                              ],
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
            Container(
//              color: Colors.blue,
              child: Column(
                children: <Widget>[
                  Padding(
                    padding: const EdgeInsets.only(
                        top: 10, bottom: 10, left: 2, right: 2),
                    child: Text(
                      'การบริการและบรรยากาศดีมาก มีห้องอาบน้ำพร้อมผ้าเช็ดตัว สบู่ ครีมสระผม พนักงานดูแลเอาใจใส่ และคอยแนะนำตลอดจนถึง therapist มีความเป็นมืออาชีพให้ความผ่อนคลายแก่ลูกค้า',
                      style: TextStyle(
                        fontSize: SizeConfig.getFontSize(12),
                      ),
                    ),
                  ),
                  Row(
                    children: <Widget>[
                      RaisedButton(
                        color: Color(0xFF3694A3),
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(20),
                        ),
                        onPressed: () {},
                        child: Text(
                          "บริการดีมาก",
                          style: TextStyle(
                            color: Colors.white,
                          ),
                        ),
                      ),
                      SizedBox(
                        width: SizeConfig.getWidth(14),
                      ),
                      RaisedButton(
                        color: Color(0xFF3694A3),
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(20),
                        ),
                        onPressed: () {},
                        child: Padding(
                          padding: const EdgeInsets.only(
                            right: 10,
                            left: 10,
                          ),
                          child: Text(
                            "คุ้มค่าดี",
                            style: TextStyle(
                              color: Colors.white,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: SizeConfig.getHeight(10),
                  ),
                ],
              ),
            ),
            Container(
              color: Color(0xFFF2F2F2),
              child: Padding(
                padding: const EdgeInsets.only(
                  left: 30,
                  top: 20,
                  bottom: 20,
                ),
                child: Row(
                  children: <Widget>[
                    ClipRRect(
                      borderRadius: BorderRadius.circular(10),
                      child: Image.asset(
                        "assets/images/demo_img.png",
                        width: 100.0,
                        height: 90.0,
                        fit: BoxFit.cover,
                      ),
                    ),
                    SizedBox(
                      width: SizeConfig.getWidth(10),
                    ),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        Text(
                          'service : Spa Cenvaree',
                          style: TextStyle(
                              fontSize: SizeConfig.getFontSize(14),
                              color: Colors.black),
                        ),
                        Text(
                          "Ladies' Day",
                          style: TextStyle(
                              fontSize: SizeConfig.getFontSize(14),
                              color: Colors.black),
                        ),
                        SizedBox(
                          height: SizeConfig.getHeight(5),
                        ),
                        Text(
                          "03/16/2019 12:49",
                          style: TextStyle(
                            fontSize: SizeConfig.getFontSize(14),
                            color: Color(0xFF6AB3AA),
                          ),
                        ),
                        SizedBox(
                          height: SizeConfig.getHeight(9),
                        ),
                        Row(
                          children: <Widget>[
                            Icon(
                              Icons.access_time,
                              color: Color(0xFFEEAFB7),
                            ),
                            Text(' 150Min')
                          ],
                        )
                      ],
                    ),
                  ],
                ),
              ),
            ),
            SizedBox(
              height: SizeConfig.getHeight(30),
            ),
            Container(
//              color: Colors.deepPurpleAccent,
              child: Row(
                children: <Widget>[
                  ClipRRect(
                    borderRadius: BorderRadius.circular(50),
                    child: Image.asset(
                      'assets/images/ic_userimg.png',
                      width: 55.0,
                      height: 55.0,
                      fit: BoxFit.cover,
                    ),
                  ),
                  SizedBox(
                    width: SizeConfig.getWidth(10),
                  ),
                  Expanded(
                    child: Container(
//                      color: Colors.green,
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: <Widget>[
                          SingleChildScrollView(
                            child: Row(
                              children: <Widget>[
                                Text(
                                  'Rattaya Pratumkan',
                                  style: TextStyle(
                                      fontSize: SizeConfig.getFontSize(20),
                                      color: Colors.black),
                                ),
                                Spacer(),
                                Container(
                                  child: Icon(Icons.more_vert),
                                )
                              ],
                            ),
                          ),
                          SizedBox(
                            height: SizeConfig.getHeight(5),
                          ),
                          Container(
//                            color: Colors.blue,
                            child: Row(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: <Widget>[
                                RatingStar(
                                  isRating: true,
                                  rate: rate1,
                                  starSize: 20,
                                  onChangeRate: (i) {
                                    setState(() {
                                      rate1 = i;
                                      print(i);
                                    });
                                  },
                                ),
                              ],
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
            Container(
//              color: Colors.blue,
              child: Column(
                children: <Widget>[
                  Padding(
                    padding: const EdgeInsets.only(
                        top: 10, bottom: 10, left: 2, right: 2),
                    child: Text(
                      'การบริการและบรรยากาศดีมาก มีห้องอาบน้ำพร้อมผ้าเช็ดตัว สบู่ ครีมสระผม พนักงานดูแลเอาใจใส่ และคอยแนะนำตลอดจนถึง therapist มีความเป็นมืออาชีพให้ความผ่อนคลายแก่ลูกค้า',
                      style: TextStyle(
                        fontSize: SizeConfig.getFontSize(12),
                      ),
                    ),
                  ),
                  Row(
                    children: <Widget>[
                      RaisedButton(
                        color: Color(0xFF3694A3),
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(20),
                        ),
                        onPressed: () {},
                        child: Text(
                          "บริการดีมาก",
                          style: TextStyle(
                            color: Colors.white,
                          ),
                        ),
                      ),
                      SizedBox(
                        width: SizeConfig.getWidth(14),
                      ),
                      RaisedButton(
                        color: Color(0xFF3694A3),
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(20),
                        ),
                        onPressed: () {},
                        child: Padding(
                          padding: const EdgeInsets.only(
                            right: 10,
                            left: 10,
                          ),
                          child: Text(
                            "คุ้มค่าดี",
                            style: TextStyle(
                              color: Colors.white,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: SizeConfig.getHeight(10),
                  ),
                ],
              ),
            ),
            Container(
              color: Color(0xFFF2F2F2),
              child: Padding(
                padding: const EdgeInsets.only(
                  left: 30,
                  top: 20,
                  bottom: 20,
                ),
                child: Row(
                  children: <Widget>[
                    ClipRRect(
                      borderRadius: BorderRadius.circular(10),
                      child: Image.asset(
                        "assets/images/demo_img.png",
                        width: 100.0,
                        height: 90.0,
                        fit: BoxFit.cover,
                      ),
                    ),
                    SizedBox(
                      width: SizeConfig.getWidth(10),
                    ),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        Text(
                          'service : Spa Cenvaree',
                          style: TextStyle(
                              fontSize: SizeConfig.getFontSize(14),
                              color: Colors.black),
                        ),
                        Text(
                          "Ladies' Day",
                          style: TextStyle(
                              fontSize: SizeConfig.getFontSize(14),
                              color: Colors.black),
                        ),
                        SizedBox(
                          height: SizeConfig.getHeight(5),
                        ),
                        Text(
                          "03/16/2019 12:49",
                          style: TextStyle(
                            fontSize: SizeConfig.getFontSize(14),
                            color: Color(0xFF6AB3AA),
                          ),
                        ),
                        SizedBox(
                          height: SizeConfig.getHeight(9),
                        ),
                        Row(
                          children: <Widget>[
                            Icon(
                              Icons.access_time,
                              color: Color(0xFFEEAFB7),
                            ),
                            Text(' 150Min')
                          ],
                        )
                      ],
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
