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

class ServiceTicketPage extends StatefulWidget {
  @override
  _ServiceTicketPageState createState() => _ServiceTicketPageState();
}

class _ServiceTicketPageState extends State<ServiceTicketPage> {

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

  Widget myCard(){
    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: 15,left: 15,bottom: 20,top: 20),
//                          color: Colors.yellow,
          child: Row(
            children: <Widget>[
              Expanded(
                flex: 3,
                child: Container(
//                          color: Colors.blue,
                  height: SizeConfig.getHeight(200),
                  child: Image.asset("assets/images/demo_img.png",
                    fit: BoxFit.cover,),
                ),
              ),
              Expanded(
                flex: 5,
                child: Container(
                  margin: EdgeInsets.only(left: 15),
//                          color: Colors.yellow,
                  height: SizeConfig.getHeight(200),
                  child: Column(
                    children: <Widget>[
                      Expanded(
                        flex: 3,
                        child: Container(
                          alignment: Alignment.topLeft,
                          padding: EdgeInsets.all(10),
                          color: Color(0xffEFEFEF),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: <Widget>[
                              Text("เรามีนัดกันในอีก",style: TextStyle(
                                  color: Color(0xffEEAFB7),
                                  fontSize: SizeConfig.getFontSize(10),
                                  fontFamily: "SF_Pro_Text",
                                  fontWeight: FontWeight.w500),),

                              Row(
                                crossAxisAlignment: CrossAxisAlignment.end,
                                children: <Widget>[
                                  Text("11 Days",style: TextStyle(
                                      color: Colors.red,
                                      fontSize: SizeConfig.getFontSize(16),
                                      fontFamily: "SF_Pro_Text",
                                      fontWeight: FontWeight.w500),),
                                  SizedBox(
                                    width: 5,
                                  ),
                                  Text("20/04/2019 : 10 AM",style: TextStyle(
                                      color: Color(0xffEEAFB7),
                                      fontSize: SizeConfig.getFontSize(10),
                                      fontFamily: "SF_Pro_Text",
                                      fontWeight: FontWeight.w500),),
                                ],
                              )
                            ],
                          ),
                        ),
                      ),
                      Expanded(
                        flex: 4,
                        child: Container(
                          padding: EdgeInsets.all(10),
                          alignment: Alignment.topLeft,
//                                  color: Colors.red,
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: <Widget>[
                              Text("Thai Body Balance",style: TextStyle(
                                  color: Colors.black,
                                  fontSize: SizeConfig.getFontSize(12),
                                  fontFamily: "SF_Pro_Text",
                                  fontWeight: FontWeight.w500),),
                              SizedBox(
                                height: 5,
                              ),
                              Text("SPA Cenvaree @ Centara Grand CentralWorld Bangkok",style: TextStyle(
                                  color: Color(0xff969696),
                                  fontSize: SizeConfig.getFontSize(11),
                                  fontFamily: "SF_Pro_Text",
                                  fontWeight: FontWeight.w500),),
                            ],
                          ),
                        ),
                      ),
                      Expanded(
                        flex: 3,
                        child: Container(
                          padding: EdgeInsets.only(left: 10,right: 10),
                          alignment: Alignment.topLeft,
//                                  color: Colors.blue,
                          child: Column(
                            mainAxisAlignment: MainAxisAlignment.end,
                            children: <Widget>[
                              Row(
                                crossAxisAlignment: CrossAxisAlignment.center,
                                children: <Widget>[
                                  Icon(Icons.access_time,color: Color(0xffEEAFB7),),
                                  SizedBox(
                                    width: 5,
                                  ),
                                  Text("150 Min",style: TextStyle(
                                    color: Colors.black,
                                    fontSize: SizeConfig.getFontSize(13),
                                    fontFamily: "SF_Pro_Text",
                                  ),),
                                ],
                              ),

                              SizedBox(
                                height: 10,
                              ),

                              Row(
                                crossAxisAlignment: CrossAxisAlignment.end,
                                children: <Widget>[
                                  Text("฿599.0",style: TextStyle(fontSize: SizeConfig.getFontSize(12),decoration: TextDecoration.lineThrough,),),
                                  SizedBox(
                                    width: 15,
                                  ),
                                  Text("฿199.00",style: TextStyle(
                                      color: Colors.red,
                                      fontSize: SizeConfig.getFontSize(18),
                                      fontFamily: "SF_Pro_Text",
                                      fontWeight: FontWeight.w500),),
                                ],
                              ),
                            ],
                          ),

                        ),
                      ),

                    ],
                  ),

                ),
              ),
            ],
          )
      ),
    );
  }
}
