import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class LiveCareTypeSelect extends StatefulWidget {
  @override
  _LiveCareTypeSelectState createState() => _LiveCareTypeSelectState();
}

class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
  var languageID;
  AppSharedPreferences sharedPref = AppSharedPreferences();

  @override
  void initState() {
    getLanguageID();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: InkWell(
          onTap: () {
            Navigator.pop(context, null);
          },
          child: Icon(
            Icons.close,
            color: Colors.white,
          ),
        ),
        title: Text(TranslationBase.of(context).bookAppo,
            style: TextStyle(color: Colors.white)),
      ),
      body: SingleChildScrollView(
        child: Container(
          margin: EdgeInsets.only(left: 20.0, right: 20.0),
          child: Column(
            children: <Widget>[
              Container(
                alignment: Alignment.center,
                margin: EdgeInsets.only(top: 15.0, bottom: 10.0),
                child: Image.asset(
                    languageID == 'ar'
                        ? "assets/images/new-design/liveCare_ar_bg.png"
                        : "assets/images/new-design/liveCare_en_bg.png",
                    width: 120),
              ),
              Container(
                  alignment: Alignment.center,
                  child: Text(TranslationBase.of(context).livecareService,
                      style: TextStyle(
                          fontWeight: FontWeight.bold, fontSize: 20.0))),
              Container(
                  margin: EdgeInsets.only(top: 10.0),
                  alignment: Alignment.center,
                  child: Text(
                      TranslationBase.of(context).livecareServiceDesc,
                      textAlign: TextAlign.center,
                      style: TextStyle(fontSize: 18.0))),
              Container(
                  margin: EdgeInsets.only(top: 15.0),
                  child: Text(TranslationBase.of(context).whyLivecare,
                      style: TextStyle(
                          fontWeight: FontWeight.bold, fontSize: 20.0))),
              Container(
                margin: EdgeInsets.only(top: 20.0, left: 20.0),
                child: Row(
                  children: <Widget>[
                    SvgPicture.asset("assets/images/new-design/check_icon.svg",
                        width: 25),
                    Container(
                      width: MediaQuery.of(context).size.width * 0.72,
                      margin: EdgeInsets.all(10.0),
                      child: Text(
                          TranslationBase.of(context).livecarePoint1,
                          overflow: TextOverflow.clip,
                          style: TextStyle(fontSize: 14.0)),
                    )
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: 5.0, left: 20.0),
                child: Row(
                  children: <Widget>[
                    SvgPicture.asset("assets/images/new-design/check_icon.svg",
                        width: 25),
                    Container(
                      width: MediaQuery.of(context).size.width * 0.72,
                      margin: EdgeInsets.all(10.0),
                      child: Text(TranslationBase.of(context).docVirtualAppoIns4,
                          overflow: TextOverflow.clip,
                          style: TextStyle(fontSize: 14.0)),
                    )
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: 5.0, left: 20.0),
                child: Row(
                  children: <Widget>[
                    SvgPicture.asset("assets/images/new-design/check_icon.svg",
                        width: 25),
                    Container(
                      width: MediaQuery.of(context).size.width * 0.72,
                      margin: EdgeInsets.all(10.0),
                      child: Text(TranslationBase.of(context).docVirtualAppoIns5,
                          overflow: TextOverflow.clip,
                          style: TextStyle(fontSize: 14.0)),
                    )
                  ],
                ),
              ),
              Container(
                  margin: EdgeInsets.only(top: 20.0),
                  child: Text(
                      TranslationBase.of(context).livecareSummary,
                      style: TextStyle(fontSize: 16.0))),
              InkWell(
                onTap: (){
                  Navigator.pop(context, "immediate");
                },
                child: Container(
                    decoration: BoxDecoration(
                        color: Colors.red[900],
                        borderRadius: BorderRadius.all(Radius.circular(10.0))),
                    height: 120.0,
                    margin: EdgeInsets.only(top: 20.0),
                    child: Row(
                      children: <Widget>[
                        Container(
                          margin: EdgeInsets.only(left: 10.0, right: 10.0),
                          child: SvgPicture.asset(
                              "assets/images/new-design/liveCare_logo_icon_white.svg",
                              width: 80),
                        ),
                        Container(
                          width: MediaQuery.of(context).size.width * 0.56,
                          margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0),
                          child: Column(
                            children: <Widget>[
                              Text(TranslationBase.of(context).livecareOption1,
                                  overflow: TextOverflow.clip,
                                  style: TextStyle(
                                      fontWeight: FontWeight.bold,
                                      fontSize: 18.0,
                                      color: Colors.white)),
                              Container(
                                margin: EdgeInsets.only(top: 10.0),
                                child: Text(TranslationBase.of(context).livecareOption2,
                                    style: TextStyle(
                                        fontSize: 18.0, color: Colors.white)),
                              )
                            ],
                          ),
                        ),
                      ],
                    )),
              ),
              InkWell(
                onTap: (){
                  Navigator.pop(context, "schedule");
                },
                child: Container(
                    decoration: BoxDecoration(
                        color: Colors.grey[700],
                        borderRadius: BorderRadius.all(Radius.circular(10.0))),
                    height: 120.0,
                    margin: EdgeInsets.only(top: 20.0),
                    child: Row(
                      children: <Widget>[
                        Container(
                          margin: EdgeInsets.only(left: 10.0, right: 10.0),
                          child: Image.asset(
                              "assets/images/new-design/calendar.png",
                              width: 70),
                        ),
                        Container(
                          width: MediaQuery.of(context).size.width * 0.58,
                          margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0),
                          child: Column(
                            children: <Widget>[
                              Container(
                                child: Text(TranslationBase.of(context).livecareOption3,
                                    overflow: TextOverflow.clip,
                                    style: TextStyle(
                                        fontWeight: FontWeight.bold,
                                        fontSize: 18.0,
                                        color: Colors.white)),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 10.0),
                                child: Text(TranslationBase.of(context).livecareOption4,
                                    style: TextStyle(
                                        fontSize: 18.0, color: Colors.white)),
                              )
                            ],
                          ),
                        ),
                      ],
                    )),
              ),
              SizedBox(
                height: 40.0,
              ),
            ],
          ),
        ),
      ),
    );
  }

  getLanguageID() async {
    var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
    setState(() {
      this.languageID = languageID;
    });
  }
}
