import 'package:flutter/material.dart';

class DescriptionField extends StatelessWidget {
  final FormFieldSetter<String> onSaved;
  const DescriptionField({Key? key, required this.onSaved}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return TextFormField(
      decoration: InputDecoration(
        labelText: 'Description',
        labelStyle: const TextStyle(color: Colors.white70),
        filled: true,
        fillColor: Colors.white.withOpacity(0.1),
        border: const OutlineInputBorder(
          borderRadius: BorderRadius.all(Radius.circular(10.0)),
          borderSide: BorderSide.none,
        ),
        prefixIcon: const Icon(Icons.description, color: Colors.white70),
      ),
      style: const TextStyle(color: Colors.white),
      maxLines: 3,
      validator: (value) {
        if (value == null || value.isEmpty) {
          return 'Veuillez entrer une description';
        }
        return null;
      },
      onSaved: onSaved,
    );
  }
}
