import 'package:flutter/material.dart';

import 'package:pweb/utils/text_field_styles.dart';

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


class NameField extends StatelessWidget {
  final TextEditingController controller;

  const NameField({
    super.key,
    required this.controller,
  });

  @override
  Widget build(BuildContext context) => TextFormField(
    controller: controller,
    decoration: getInputDecoration(context, AppLocalizations.of(context)!.accountName, true),
    style: getTextFieldStyle(context, true),
    validator: (value) => (value == null || value.trim().isEmpty) ? AppLocalizations.of(context)!.errorNameMissing : null,
  );
}
