import 'package:cs_resources/generated/assets.dart';
import 'package:cs_resources/generated/l10n.dart';
import 'package:cs_resources/theme/app_colors_theme.dart';
import 'package:flutter/material.dart';
import 'package:auto_route/auto_route.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:router/ext/auto_router_extensions.dart';
import 'package:widgets/ext/ex_widget.dart';
import 'package:widgets/my_appbar.dart';
import 'package:widgets/my_button.dart';
import 'package:widgets/my_load_image.dart';
import 'package:widgets/my_text_view.dart';

import '../../router/page/auth_page_router.dart';
import 'sign_up_success_view_model.dart';

//全面屏手机
class SignUpSuccessFullScreen extends HookConsumerWidget {
  const SignUpSuccessFullScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final viewModel = ref.watch(signUpSuccessViewModelProvider.notifier);

    return LayoutBuilder(
      builder: (context, constraints) {
        return Container(
          padding: const EdgeInsets.symmetric(horizontal: 20),
          width: double.infinity,
          height: constraints.maxHeight, // 占满父容器的高度
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              //顶部图片
              const MyAssetImage(
                Assets.authYyHomeSuccess,
                width: 264,
                height: 180,
              ).alignCenter().marginOnly(top: 12),

              MyTextView(
                S.current.welcome_name("Hu yu"),
                fontSize: 23,
                marginTop: 30,
                isFontMedium: true,
                textColor: context.appColors.textBlack,
              ),

              MyTextView(
                S.current.sign_up_success_txt1,
                fontSize: 15,
                marginTop: 25,
                isFontMedium: true,
                textColor: context.appColors.textBlack,
              ),

              MyTextView(
                S.current.sign_up_success_txt2,
                fontSize: 15,
                marginTop: 20,
                isFontMedium: true,
                textColor: context.appColors.textBlack,
              ),

              MyTextView(
                S.current.sign_up_success_txt3,
                fontSize: 15,
                marginTop: 20,
                isFontMedium: true,
                textColor: context.appColors.textBlack,
              ),

              const Spacer(),

              MyButton(
                onPressed: viewModel.gotoSelectEstatePage,
                text: S.current.get_started,
                textColor: Colors.white,
                backgroundColor: context.appColors.btnBgDefault,
                fontWeight: FontWeight.w500,
                type: ClickType.throttle,
                fontSize: 16,
                minHeight: 50,
                radius: 5,
              ).marginOnly(top: 50, bottom: 50, left: 18, right: 18),
            ],
          ),
        );
      },
    );
  }
}
