import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/login/forgot-password.dart';
import 'package:diplomaticquarterapp/pages/login/login.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class LoginType extends StatelessWidget {
  static int loginType = 0;

  @override
  Widget build(BuildContext context) {
    return AppScaffold(
        appBarTitle: TranslationBase.of(context).login,
        isShowAppBar: true,
        isShowDecPage: false,
        body: SingleChildScrollView(
            child: Container(
                padding:
                    EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
                height: SizeConfig.realScreenHeight * .9,
                width: SizeConfig.realScreenWidth,
                child: Column(
                  children: <Widget>[
                    Expanded(
                      flex: 4,
                      child: Column(
                          // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: <Widget>[
                            Image.asset(
                              'assets/images/DQ/logo.png',
                              height: 90,
                              width: 90,
                            ),
                            AppText(
                              TranslationBase.of(context).logintypeRadio,
                              fontSize: SizeConfig.textMultiplier * 3.5,
                              textAlign: TextAlign.start,
                              marginBottom: 20.0,
                              marginTop: 20.0,
                            ),
                            Row(
                              mainAxisAlignment: MainAxisAlignment.center,
                              children: <Widget>[
                                Expanded(
                                    child: InkWell(
                                        onTap: () => {
                                              LoginType.loginType = 1,
                                          Navigator.of(context)
                                              .push(FadePage(page: Login())),
                                            },
                                        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,
                                                    fontWeight: FontWeight.bold,
                                                  )
                                                ],
                                              ),
                                            )))),
                                Expanded(
                                    child: InkWell(
                                        onTap: () => {
                                              LoginType.loginType = 2,
                                          Navigator.of(context)
                                              .push(FadePage(page: Login())),
                                            },
                                        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,
                                                    fontWeight: FontWeight.bold,
                                                  )
                                                ],
                                              ),
                                            ))))
                              ],
                            ),
                            SizedBox(
                              height: 25,
                            ),
                            Divider(
                              color: Colors.grey,
                              height: 2,
                            ),
                            Center(
                                child: InkWell(
                                    onTap: () => {
                                      Navigator.of(context)
                                          .push(FadePage(page: ForgotPassword())),
                                        },
                                    child: AppText(
                                        TranslationBase.of(context)
                                            .forgotPassword,
                                        fontSize:
                                            SizeConfig.textMultiplier * 2.5,
                                        marginTop: 20.0,
                                        underline: true)))
                          ]),
                    ),
                    Expanded(
                        flex: 1,
                        child: Column(
                          mainAxisAlignment: MainAxisAlignment.end,
                          children: <Widget>[
                            Divider(
                              color: Colors.grey,
                              height: 2,
                            ),
                            SizedBox(
                              height: 10,
                            ),
                            Row(
                              children: <Widget>[
                                Expanded(
                                    child: DefaultButton(
                                  TranslationBase.of(context).registerNow,
                                  () => {
                                    Navigator.of(context)
                                        .push(FadePage(page: Register())),
                                  },
                                )),
                              ],
                            ),
                          ],
                        ))
                  ],
                ))));
  }
}
