import 'package:hmg_patient_app/routes.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/widgets/buttons/defaultButton.dart';
import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart';
import 'package:hmg_patient_app/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class SymptomInfo extends StatefulWidget {
  @override
  _SymptomInfo createState() => new _SymptomInfo();
}

class _SymptomInfo extends State<SymptomInfo> {
  bool checkValue = false;
  @override
  Widget build(BuildContext context) {
    return AppScaffold(
        appBarTitle: TranslationBase.of(context).termsService,
        isShowAppBar: true,
        body: Padding(
            padding: EdgeInsets.all(20),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                AppText(
                  TranslationBase.of(context).beforeUsing,
                  fontWeight: FontWeight.bold,
                  fontSize: 14,
                  // textAlign: TextAlign.center,
                ),
                Container(
                  width: MediaQuery.of(context).size.width,
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(10),
                    color: Colors.white,
                  ),
                  padding: EdgeInsets.all(30),
                  margin: EdgeInsets.all(10),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                    children: [
                      AppText(TranslationBase.of(context).remeberthat,
                          fontSize: 16),
                      SizedBox(
                        height: 10,
                      ),
                      AppText(
                        '1. ' + TranslationBase.of(context).checkDiagnosis,
                        fontWeight: FontWeight.bold,
                        fontSize: 16,
                      ),
                      AppText(TranslationBase.of(context).informational,
                          fontSize: 16),
                      SizedBox(
                        height: 10,
                      ),
                      AppText(
                        '2. ' + TranslationBase.of(context).notUseInEmbergency,
                        fontWeight: FontWeight.bold,
                        fontSize: 16,
                      ),
                      AppText(
                          TranslationBase.of(context).notUseInEmbergencyDetails,
                          fontSize: 16),
                      AppText(
                          TranslationBase.of(context).notUseInEmbergencyCall,
                          underline: true,
                          color: Colors.blue,
                          fontSize: 16),
                      SizedBox(
                        height: 10,
                      ),
                      AppText(
                        '3.' + TranslationBase.of(context).dataSafe,
                        fontWeight: FontWeight.bold,
                        fontSize: 16,
                      ),
                      AppText(TranslationBase.of(context).dataSafeInfo,
                          fontSize: 16),
                    ],
                  ),
                ),
                Expanded(
                    flex: 1,
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.end,
                      children: <Widget>[
                        Padding(
                          padding: EdgeInsets.all(10),
                          child: CheckboxListTile(
                            title: AppText(TranslationBase.of(context).accept),
                            value: checkValue,
                            onChanged: (newValue) {
                              setState(() {
                                this.checkValue = newValue!;
                              });
                            },
                            controlAffinity: ListTileControlAffinity
                                .leading, //  <-- leading Checkbox
                          ),
                        ),
                        Row(
                          children: <Widget>[
                            Expanded(
                                child: DefaultButton(
                              TranslationBase.of(context).next,
                              () => {
                                if (checkValue == true)
                                  {
                                    Navigator.of(context).pushNamed(
                                      SELECT_GENDER,
                                    )
                                  }
                              },
                              color: checkValue == true
                                  ? Colors.black
                                  : Colors.grey,
                              textColor: Colors.white,
                            ))
                          ],
                        ),
                      ],
                    ))
              ],
            )));
  }
}
