import 'package:flutter/material.dart';

/// Base interface for all field types in the Entity system
/// This allows UI to be independent of field types and enables reusability
abstract class BaseField {
  /// Unique identifier for the field (e.g., 'name', 'phone')
  String get fieldKey;
  
  /// Display label for the field (e.g., 'Name', 'Phone Number')
  String get label;
  
  /// Placeholder text for the field
  String get hint;
  
  /// Whether the field is required for validation
  bool get isRequired;
  
  /// Validation function for the field
  String? Function(String?)? get validator;
  
  /// Main method - each field type provides its own implementation
  Widget buildField({
    required TextEditingController controller,
    required ColorScheme colorScheme,
    VoidCallback? onChanged,
  });
  
  /// Optional: Field-specific styling properties
  Map<String, dynamic>? get customProperties => null;
  
  /// Optional: Field-specific validation rules
  String? Function(String?)? get customValidator => null;
}
