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

class Favorite extends StatefulWidget {
  @override
  _FavoriteState createState() => _FavoriteState();
}

class _FavoriteState extends State<Favorite> {
  bool checkBoxValue = false;

  @override
  Widget build(BuildContext context) {
    SizeConfig(context);
    return Scaffold(
      body: _setupView(),
      bottomNavigationBar: Container(
        color: Color.fromRGBO(69, 85, 79, 1),
        height: SizeConfig.getWidth(120),
        child: Column(
          children: <Widget>[
            Container(
              child: Padding(
                padding: const EdgeInsets.only(top: 40),
                child: RaisedButton(
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(25.0),
                  ),
                  onPressed: () {
//                  Navigator.push(
//                    context,
//                    MaterialPageRoute(
//                      builder: (context) => MyOrderStatus(),
//                    ),
//                  );
                  },
                  padding: EdgeInsets.only(
                    left: 150,
                    right: 150,
                    top: 15,
                    bottom: 15,
                  ),
                  color: Color(0xFF3694A3),
                  child: Text(
                    'ยืนยัน',
                    style: TextStyle(
                      fontSize: SizeConfig.getFontSize(16),
                      fontWeight: FontWeight.bold,
                      color: Colors.white,
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }

  _setupView() {
    return Column(
      children: <Widget>[
        Stack(
          children: <Widget>[
            Container(
              color: Color.fromRGBO(69, 85, 79, 1),
              height: SizeConfig.getHeight(200),
              width: MediaQuery.of(context).size.width,
            ),
            Positioned(
              top: SizeConfig.getPadding(50),
              left: SizeConfig.getPadding(
                  MediaQuery.of(context).size.width / 3.5),
              child: Container(
                alignment: Alignment.topCenter,
                child: Image.asset(
                  'assets/images/feelver_banner.png',
                  width: MediaQuery.of(context).size.width / 2.5,
                ),
              ),
            ),
            Positioned(
              top: SizeConfig.getPadding(77),
              left: SizeConfig.getPadding(16),
              child: Container(
                child: GestureDetector(
                  onTap: () {
                    showDialog(
                      context: context,
                      builder: (BuildContext context) {
                        return NavDrawer();
                      },
                    );
                  },
                  child: Image.asset(
                    'assets/images/ic_menu.png',
                    height: SizeConfig.getWidth(24),
                    width: SizeConfig.getWidth(30),
                    fit: BoxFit.cover,
                  ),
                ),
              ),
            ),
            Positioned(
              top: SizeConfig.getPadding(77),
              right: SizeConfig.getPadding(60),
              child: Container(
                child: Image.asset(
                  'assets/images/ic_noti.png',
                  height: SizeConfig.getWidth(30),
                  width: SizeConfig.getWidth(30),
                  fit: BoxFit.cover,
                ),
              ),
            ),
            Positioned(
              top: SizeConfig.getPadding(77),
              right: SizeConfig.getPadding(20),
              child: InkWell(
//                onTap: () {
//                  Navigator.push(
//                    context,
//                    MaterialPageRoute(builder: (context) => LoginPage()),
//                  );
//                },
                child: Container(
                  child: Image.asset(
                    'assets/images/ic_userimg.png',
                    height: SizeConfig.getWidth(30),
                    width: SizeConfig.getWidth(30),
                    fit: BoxFit.cover,
                  ),
                ),
              ),
            ),
          ],
        ),
        Expanded(
          child: SingleChildScrollView(
            child: Padding(
              padding: const EdgeInsets.only(
                left: 10,
                right: 10,
                top: 8,
                bottom: 8,
              ),
              child: Container(
                alignment: FractionalOffset.topLeft,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Container(
                      child: Row(
                        children: <Widget>[
                          Image.asset('assets/images/Thai massage.png'),
                          Padding(
                            padding: const EdgeInsets.only(left: 8),
                            child: Container(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: <Widget>[
                                  Row(
                                    children: <Widget>[
                                      Text(
                                        'Ivory Relax and Spa',
                                        style: TextStyle(
                                          fontSize: SizeConfig.getFontSize(16),
                                          fontFamily: "SF_Pro_Text",
                                          fontWeight: FontWeight.bold,
                                          color: Colors.black,
                                        ),
                                      ),
                                      SizedBox(
                                        width: SizeConfig.getWidth(60),
                                      ),
                                      Checkbox(
                                          checkColor: Color(0xFFEEAFB7),
                                          activeColor: Colors.white,
                                          value: checkBoxValue,
                                          onChanged: (bool value) {
                                            setState(() {
                                              print(value);
                                              checkBoxValue = value;
                                            });
                                          }),
                                    ],
                                  ),
                                  Text(
                                    'นวดแผนไทย',
                                    style: TextStyle(
                                      fontSize: SizeConfig.getFontSize(16),
                                      fontFamily: "SF_Pro_Text",
                                      color: Colors.black,
                                    ),
                                  ),
                                  SizedBox(
                                    height: SizeConfig.getHeight(10),
                                  ),
                                  Row(
                                    children: <Widget>[
                                      Row(
                                        children: <Widget>[
                                          Image.asset(
                                            'assets/images/clock.png',
                                            height: 20,
                                            width: 20,
                                          ),
                                          Text(
                                            ' 90 นาที',
                                            style: TextStyle(
                                              fontFamily: "SF_Pro_Text",
                                            ),
                                          ),
                                          SizedBox(
                                            width: SizeConfig.getWidth(110),
                                          ),
                                          Text(
                                            '฿1,599.00',
                                            style: TextStyle(
                                              decoration:
                                                  TextDecoration.lineThrough,
                                              fontSize:
                                                  SizeConfig.getFontSize(16),
                                              fontFamily: "SF_Pro_Text",
                                              color: Color(0xFFEEAFB7),
                                            ),
                                          ),
                                        ],
                                      ),
                                    ],
                                  ),
                                  Row(
                                    children: <Widget>[
                                      Container(
                                        child: Padding(
                                          padding:
                                              const EdgeInsets.only(left: 10),
                                          child: Row(
                                            children: <Widget>[
                                              SizedBox(
                                                width: 20.0,
                                                height: 20.0,
                                                child: RaisedButton(
                                                  child: Text('-'),
                                                  padding:
                                                      EdgeInsets.only(right: 0),
                                                  onPressed: () {},
                                                ),
                                              ),
                                              Padding(
                                                padding: const EdgeInsets.only(
                                                    right: 8, left: 8),
                                                child: Text('1'),
                                              ),
                                              SizedBox(
                                                width: 20.0,
                                                height: 20.0,
                                                child: RaisedButton(
                                                  child: Text('+'),
                                                  padding:
                                                      EdgeInsets.only(right: 0),
                                                  onPressed: () {},
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                      ),
                                      SizedBox(
                                        width: SizeConfig.getWidth(85),
                                      ),
                                      Text(
                                        '฿1,200.00',
                                        style: TextStyle(
                                          fontSize: SizeConfig.getFontSize(20),
                                          color: Color(0xFFFD2956),
                                          fontFamily: "SF_Pro_Text",
                                          fontWeight: FontWeight.bold,
                                        ),
                                      ),
                                    ],
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                    Divider(
                      color: Colors.black,
                      height: 20,
                      indent: 8,
                      endIndent: 20,
                    ),
                    Container(
                      child: Row(
                        children: <Widget>[
                          Image.asset('assets/images/Thai massage.png'),
                          Padding(
                            padding: const EdgeInsets.only(left: 8),
                            child: Container(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: <Widget>[
                                  Row(
                                    children: <Widget>[
                                      Text(
                                        'Ivory Relax and Spa',
                                        style: TextStyle(
                                          fontSize: SizeConfig.getFontSize(16),
                                          fontFamily: "SF_Pro_Text",
                                          fontWeight: FontWeight.bold,
                                          color: Colors.black,
                                        ),
                                      ),
                                      SizedBox(
                                        width: SizeConfig.getWidth(60),
                                      ),
                                      Checkbox(
                                          checkColor: Color(0xFFEEAFB7),
                                          activeColor: Colors.white,
                                          value: checkBoxValue,
                                          onChanged: (bool value) {
                                            setState(() {
                                              print(value);
                                              checkBoxValue = value;
                                            });
                                          }),
                                    ],
                                  ),
                                  Text(
                                    'นวดแผนไทย',
                                    style: TextStyle(
                                      fontSize: SizeConfig.getFontSize(16),
                                      fontFamily: "SF_Pro_Text",
                                      color: Colors.black,
                                    ),
                                  ),
                                  SizedBox(
                                    height: SizeConfig.getHeight(10),
                                  ),
                                  Row(
                                    children: <Widget>[
                                      Row(
                                        children: <Widget>[
                                          Image.asset(
                                            'assets/images/clock.png',
                                            height: 20,
                                            width: 20,
                                          ),
                                          Text(
                                            ' 90 นาที',
                                            style: TextStyle(
                                              fontFamily: "SF_Pro_Text",
                                            ),
                                          ),
                                          SizedBox(
                                            width: SizeConfig.getWidth(110),
                                          ),
                                          Text(
                                            '฿1,599.00',
                                            style: TextStyle(
                                              decoration:
                                                  TextDecoration.lineThrough,
                                              fontSize:
                                                  SizeConfig.getFontSize(16),
                                              fontFamily: "SF_Pro_Text",
                                              color: Color(0xFFEEAFB7),
                                            ),
                                          ),
                                        ],
                                      ),
                                    ],
                                  ),
                                  Row(
                                    children: <Widget>[
                                      Container(
                                        child: Padding(
                                          padding:
                                              const EdgeInsets.only(left: 10),
                                          child: Row(
                                            children: <Widget>[
                                              SizedBox(
                                                width: 20.0,
                                                height: 20.0,
                                                child: RaisedButton(
                                                  child: Text('-'),
                                                  padding:
                                                      EdgeInsets.only(right: 0),
                                                  onPressed: () {},
                                                ),
                                              ),
                                              Padding(
                                                padding: const EdgeInsets.only(
                                                    right: 8, left: 8),
                                                child: Text('1'),
                                              ),
                                              SizedBox(
                                                width: 20.0,
                                                height: 20.0,
                                                child: RaisedButton(
                                                  child: Text('+'),
                                                  padding:
                                                      EdgeInsets.only(right: 0),
                                                  onPressed: () {},
                                                ),
                                              ),
                                            ],
                                          ),
                                        ),
                                      ),
                                      SizedBox(
                                        width: SizeConfig.getWidth(85),
                                      ),
                                      Text(
                                        '฿1,200.00',
                                        style: TextStyle(
                                          fontSize: SizeConfig.getFontSize(20),
                                          color: Color(0xFFFD2956),
                                          fontFamily: "SF_Pro_Text",
                                          fontWeight: FontWeight.bold,
                                        ),
                                      ),
                                    ],
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                    Divider(
                      color: Colors.black,
                      height: 40,
                      indent: 8,
                      endIndent: 20,
                    ),
                  ],
                ),
              ),
            ),
          ),
        ),
      ],
    );
  }
}
