# LocalDate.parse constructor

LocalDate.parse(

1. String dateString

)

Parses a LocalDate from an ISO string in the format `YYYY-MM-DD`.

Throws InvalidFormatException if the input is invalid.

Example:

    final date = LocalDate.parse("2024-06-27");

Represents a calendar date without time or timezone.

This class provides date-only operations such as computing weekdays, adding or subtracting days/months/years, and converting from/to strings.

It ensures valid dates (e.g. February never has more than 29 days).

### Example

    final date = LocalDate(2024, 6, 27);
    print(date); // "2024-06-27"

## Implementation

    factory LocalDate.parse(String dateString) {
      final parts = dateString.split('-');
      if (parts.length != 3) {
        throw InvalidFormatException('Invalid date format. Expected YYYY-MM-DD');
      }
      final year = int.parse(parts[0]);
      final month = int.parse(parts[1]);
      final day = int.parse(parts[2]);
      return LocalDate(year, month, day);
    }