import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

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

class _WelcomeLogin extends State<WelcomeLogin> {
  bool isLoading = true;

  @override
  void initState() {
    isLoading = true;
    super.initState();
  }

  Widget build(BuildContext context) {
    return AppScaffold(
      appBarTitle: TranslationBase.of(context).welcome,
      isShowDecPage: false,
      isShowAppBar: true,
      showNewAppBar: true,
      backgroundColor: Color(0xffF8F8F8),
      showNewAppBarTitle: false,
      body: Column(
        children: <Widget>[
          Expanded(
            child: ListView(
              padding: EdgeInsets.only(left: 21, right: 21),
              physics: BouncingScrollPhysics(),
              children: [
                SizedBox(height: 12),
                Row(
                  children: [
                    SvgPicture.asset(
                      "assets/images/new/hmg_icon.svg",
                      height: 62,
                      width: 62,
                    ),
                  ],
                ),
                SizedBox(height: 24),
                Text(
                  TranslationBase.of(context).welcome,
                  style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24),
                ),
                SizedBox(height: 16),
                // Text(
                //   TranslationBase.of(context).welcomeText,
                //   style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
                // ),
                Text(
                  TranslationBase.of(context).welcomeText2,
                  style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
                ),
                SizedBox(
                  height: 14,
                ),
              ],
            ),
          ),
          Container(
            color: Colors.white,
            padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
            child: Row(
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                Expanded(
                  child: DefaultButton(
                    TranslationBase.of(context).no,
                    () => {
                      locator<GAnalytics>().loginRegistration.visited_alhabib_group(false),
                      Navigator.of(context).push(FadePage(page: RegisterNew())),
                    },
                    color: CustomColors.accentColor,
                    textColor: Colors.white,
                  ),
                ),
                SizedBox(width: 8),
                Expanded(
                  child: DefaultButton(
                    TranslationBase.of(context).yes,
                    () => {
                      locator<GAnalytics>().loginRegistration.visited_alhabib_group(true),
                      Navigator.of(context).push(FadePage(page: LoginType())),
                    },
                    color: CustomColors.green,
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
