import 'package:flutter/material.dart';

import 'package:pweb/pages/signup/form/controllers.dart';
import 'package:pweb/pages/signup/form/description.dart';
import 'package:pweb/pages/signup/header.dart';
import 'package:pweb/widgets/password/ui_controller.dart';
import 'package:pweb/widgets/password/verify.dart';
import 'package:pweb/widgets/text_field.dart';
import 'package:pweb/widgets/username.dart';
import 'package:pweb/widgets/vspacer.dart';

import 'package:pweb/generated/i18n/app_localizations.dart';


class SignUpFormFields extends StatelessWidget {
  final SignUpFormControllers controllers;

  const SignUpFormFields({required this.controllers, super.key});

  @override
  Widget build(BuildContext context) => Column(
    children: [
      const SignUpHeader(),
      const VSpacer(),
      NotEmptyTextFormField(
        controller: controllers.companyName,
        labelText: AppLocalizations.of(context)!.companyName,
        readOnly: false,
        error: AppLocalizations.of(context)!.companynameRequired,
      ),
      const VSpacer(),
      DescriptionField(controller: controllers.description),
      const VSpacer(),
      NotEmptyTextFormField(
        controller: controllers.firstName,
        labelText: AppLocalizations.of(context)!.firstName,
        readOnly: false,
        error: AppLocalizations.of(context)!.enterFirstName,
      ),
      const VSpacer(),
      NotEmptyTextFormField(
        controller: controllers.lastName,
        labelText: AppLocalizations.of(context)!.lastName,
        readOnly: false,
        error: AppLocalizations.of(context)!.enterLastName,
      ),
      const VSpacer(),
      UsernameField(controller: controllers.email),
      const VSpacer(),
      PasswordUiController(controller: controllers.password),
      const VSpacer(multiplier: 2.0),
      VerifyPasswordField(
        controller: controllers.passwordConfirm,
        externalPasswordController: controllers.password,
      ),
      const VSpacer(multiplier: 2.0),
    ],
  );
}
