import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/routes.dart';

class WelcomeLogin extends StatefulWidget {
  @override
  _WelcomeLogin createState() => _WelcomeLogin();
}

class _WelcomeLogin extends State<WelcomeLogin> {
  bool isLoading = true;
  @override
  void initState() {
    isLoading = true;
    // checkUser(context);
    super.initState();
  }

  Widget build(BuildContext context) {
    return AppScaffold(
        appBarTitle: TranslationBase.of(context).welcome,
        isShowAppBar: true,
        body: Padding(
            padding: EdgeInsets.all(20),
            child: Column(
              children: <Widget>[
                Expanded(
                  flex: 6,
                  child: Column(
                      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        Image.asset(
                          'assets/images/habib-logo.png',
                          height: 80,
                          width: 80,
                        ),
                        Text(
                          TranslationBase.of(context).welcome,
                          style: TextStyle(fontSize: 30),
                          textAlign: TextAlign.left,
                        ),
                        Text(
                          TranslationBase.of(context).welcomeText,
                          style: TextStyle(fontSize: 24),
                          textAlign: TextAlign.left,
                        ),
                        Text(
                          TranslationBase.of(context).welcomeText2,
                          style: TextStyle(fontSize: 24),
                          textAlign: TextAlign.left,
                        ),
                        SizedBox(
                          height: SizeConfig.realScreenHeight * .2,
                        )
                      ]),
                ),
                Expanded(
                    flex: 2,
                    child: Column(
                      //mainAxisAlignment: MainAxisAlignment.end,
                      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                      children: <Widget>[
                        Row(
                          children: <Widget>[
                            Expanded(
                                child: DefaultButton(
                              TranslationBase.of(context).yes,
                              () => {
                                Navigator.of(context).pushNamed(
                                  LOGIN_TYPE,
                                ),
                              },
                              color: Colors.red[900],
                              textColor: Colors.white,
                            ))
                          ],
                        ),
                        Row(
                          children: <Widget>[
                            Expanded(
                                child: DefaultButton(
                              TranslationBase.of(context).no,
                              () => {
                                Navigator.of(context).pushNamed(
                                  REGISTER,
                                )
                              },
                            ))
                          ],
                        ),
                      ],
                    ))
              ],
            )));
  }
}
