import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:keyboard/base/base_view.dart';
import 'package:keyboard/module/new_user/new_user_controller.dart';
import 'package:flutter/material.dart';
import 'package:keyboard/utils/styles.dart';

import '../../../../resource/string.gen.dart';
class StepNicknameView extends BaseView<NewUserController>{
  const StepNicknameView({super.key});
  @override
  Color backgroundColor() {
    return Colors.transparent;
  }

  @override
  Widget buildBody(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Container(
          margin: EdgeInsets.only(left: 30.w, right: 30.w),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                StringName.newUserNicknameTitle,
                style: TextStyle(
                  color: Colors.black.withAlpha(204),
                  fontSize: 22.sp,
                  fontWeight: FontWeight.w500,
                  height: 0,
                ),
              ),
              SizedBox(height: 7.h),
              Text(
                StringName.newUserNicknameDesc,
                style: TextStyle(
                  color: Colors.black.withAlpha(153),
                  fontSize: 14.sp,
                  fontWeight: FontWeight.w400,
                ),
              ),
            ],
          ),
        ),
        SizedBox(height: 72.w),
        _buildContent(context),
      ],
    );
  }


  Widget _buildContent(BuildContext context) {
    return    Container(
      margin: EdgeInsets.only( left: 27.w, right: 27.w),
      alignment: Alignment.center,
      child: Container(
        height: 48.h,
        alignment: Alignment.center,
        child: TextField(
          controller: controller.textEditingController,
          // maxLength: maxLength,
          maxLines: 1,
          onChanged: (value) {
            controller.nickname.value = value;
          },
          style: Styles.getTextStyleBlack204W500(18.sp),
          cursorColor: Color(0xFF7B7DFF),
          textAlign: TextAlign.center,
          textAlignVertical: TextAlignVertical.center,
          decoration: InputDecoration(
            isDense: true,
            counterText: "",
            hintText: "请输入你的昵称",
            hintStyle: TextStyle(
              color: Colors.black.withAlpha(77),
              fontSize: 18.sp,
              fontWeight: FontWeight.w500,
            ),
            border: UnderlineInputBorder(
              borderSide: BorderSide(
                color: Colors.black.withAlpha(26),
                width: 1.w,
              ),
            ),
            focusedBorder: UnderlineInputBorder(
              borderSide: BorderSide(
                color: Colors.black.withAlpha(26),
                width: 1.w,
              ),
            ),
            enabledBorder: UnderlineInputBorder(
              borderSide: BorderSide(
                color: Colors.black.withAlpha(26),
                width: 1.w,
              ),
            ),
            filled: true,
            fillColor: Colors.transparent,
          ),
        ),
      ),
    );
  }



}