import 'package:hmg_patient_app/config/size_config.dart';
import 'package:hmg_patient_app/routes.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/widgets/card/rounded_container.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';
import 'package:flutter_svg/svg.dart';
import 'package:hmg_patient_app/widgets/habib_logo_widget.dart';

class AddFamilyMemberType extends StatelessWidget {
  static int loginType = 0;
  @override
  Widget build(BuildContext context) {
    return AppScaffold(
        appBarTitle: TranslationBase.of(context).myFamilyFiles,
        isShowAppBar: true,
        showNewAppBar: true,
        showNewAppBarTitle: true,
        body: Padding(
          padding: EdgeInsets.only(bottom: 20, left: 21, right: 21),
          child: Column(children: [
            Expanded(
              child: ListView(
                padding: EdgeInsets.zero,
                physics: BouncingScrollPhysics(),
                children: [
                  SizedBox(height: 21),
                  HabibLogoWidget(),
                  SizedBox(height: 21),
                  Text(
                    TranslationBase.of(context).registerInfoFamily,
                    style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
                  ),
                  GridView(
                    gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
                    physics: NeverScrollableScrollPhysics(),
                    padding: EdgeInsets.only(top: 25),
                    shrinkWrap: true,
                    children: [
                      getButton(context, TranslationBase.of(context).nationalIdNumber, 'assets/images/new/national_id.svg', 1),
                      getButton(context, TranslationBase.of(context).medicalFileNumber, 'assets/images/new/medical_file.svg', 2),
                    ],
                  ),
                  SizedBox(height: 20),
                  // RichText(
                  //   text: TextSpan(
                  //     text: TranslationBase.of(context).forgotPassword,
                  //     style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12),
                  //     recognizer: TapGestureRecognizer()..onTap = () => Navigator.of(context).push(FadePage(page: ForgotPassword())),
                  //   ),
                  // ),
                ],
              ),
            ),
            // SizedBox(
            //   height: 43,
            //   width: double.infinity,
            //   child: FlatButton(
            //     onPressed: () {},
            //     child: Text(
            //       TranslationBase.of(context).registerNow,
            //       style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48),
            //     ),
            //     color: Color(0xffD02127),
            //     shape: RoundedRectangleBorder(
            //       borderRadius: BorderRadius.circular(6),
            //     ),
            //   ),
            // ),
          ]),
        ));
    // body: Padding(
    //     padding: EdgeInsets.all(20),
    //     child: Column(
    //       children: <Widget>[
    //         Expanded(
    //           flex: 6,
    //           child: Column(
    //               // mainAxisAlignment: MainAxisAlignment.spaceBetween,
    //               crossAxisAlignment: CrossAxisAlignment.start,
    //               children: <Widget>[
    //                 Image.asset(
    //                   'assets/images/habib-logo.png',
    //                   height: 80,
    //                   width: 80,
    //                 ),
    //                 Padding(
    //                   padding: EdgeInsets.all(20),
    //                   child: AppText(
    //                     TranslationBase.of(context).registerInfoFamily,
    //                     fontSize: SizeConfig.textMultiplier * 3.5,
    //                     textAlign: TextAlign.left,
    //                   ),
    //                 ),
    //                 Padding(
    //                     padding: EdgeInsets.all(20),
    //                     child: Row(
    //                       mainAxisAlignment: MainAxisAlignment.center,
    //                       children: <Widget>[
    //                         Expanded(
    //                             child: InkWell(
    //                                 onTap: () => {AddFamilyMemberType.loginType = 1, Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER)},
    //                                 child: RoundedContainer(
    //                                     borderColor: Colors.grey,
    //                                     showBorder: true,
    //                                     child: Padding(
    //                                       padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
    //                                       child: Column(
    //                                         mainAxisAlignment: MainAxisAlignment.center,
    //                                         children: <Widget>[
    //                                           Image.asset(
    //                                             'assets/images/id_card_icon.png',
    //                                             height: SizeConfig.imageSizeMultiplier * 12,
    //                                             width: SizeConfig.imageSizeMultiplier * 15,
    //                                           ),
    //                                           SizedBox(
    //                                             height: 20,
    //                                           ),
    //                                           AppText(
    //                                             TranslationBase.of(context).idNo,
    //                                             fontSize: SizeConfig.textMultiplier * 2,
    //                                           )
    //                                         ],
    //                                       ),
    //                                     )))),
    //                         Expanded(
    //                             child: InkWell(
    //                                 onTap: () => {AddFamilyMemberType.loginType = 2, Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER)},
    //                                 child: RoundedContainer(
    //                                     borderColor: Colors.grey,
    //                                     showBorder: true,
    //                                     child: Padding(
    //                                       padding: EdgeInsets.fromLTRB(25, 10, 25, 10),
    //                                       child: Column(
    //                                         children: <Widget>[
    //                                           Image.asset(
    //                                             'assets/images/my_file_white_icon.png',
    //                                             height: SizeConfig.imageSizeMultiplier * 12,
    //                                             width: SizeConfig.imageSizeMultiplier * 15,
    //                                           ),
    //                                           SizedBox(
    //                                             height: 20,
    //                                           ),
    //                                           AppText(
    //                                             TranslationBase.of(context).fileNo,
    //                                             fontSize: SizeConfig.textMultiplier * 2,
    //                                           )
    //                                         ],
    //                                       ),
    //                                     ))))
    //                       ],
    //                     )),
    //                 Divider(
    //                   color: Colors.grey,
    //                   height: 2,
    //                 ),
    //               ]),
    //         ),
    //         // Expanded(
    //         //     flex: 2,
    //         //     child: Column(
    //         //       mainAxisAlignment: MainAxisAlignment.end,
    //         //       children: <Widget>[
    //         //         Row(
    //         //           children: <Widget>[
    //         //             Expanded(
    //         //                 child: DefaultButton(
    //         //               TranslationBase.of(context).registerNow,
    //         //               () => {
    //         //                 Navigator.of(context).pushNamed(
    //         //                   REGISTER,
    //         //                 )
    //         //               },
    //         //             ))
    //         //           ],
    //         //         ),
    //         //       ],
    //         //     ))
    //       ],
    //     )));
  }

  Widget getButton(BuildContext _context, String _title, String _icon, int _flag) {
    return InkWell(
      onTap: () {
        AddFamilyMemberType.loginType = _flag;
        Navigator.of(_context).pushNamed(ADD_FAMILY_MEMBER);
      },
      child: Container(
        padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(15),
          color: Colors.white,
          border: Border.all(
            color: Color(0xffefefef),
            width: 1,
          ),
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            SvgPicture.asset(
              _icon,
              height: 38,
              width: 38,
            ),
            Text(
              _title,
              style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
            ),
          ],
        ),
      ),
    );
  }
}
