> ## Documentation Index
> Fetch the complete documentation index at: https://starrycodes.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# File - Type Checks

>  Powerful extensions for dart:io.File to simplify size formatting, path manipulation, and type checking for local files.

<Steps titleSize="h3">
  <Step title="Getters">
    <ResponseField name="type" type="FileType">
      Resolves and returns the general `FileType` based on a hierarchical check of the file's extension and name.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      final type = File('song.mp3').type; // FileType.audio

      switch (type) {
          case FileType.image: ...
          case FileType.unknown: ...
      }
      ```
    </ResponseField>

    <ResponseField name="isImage" type="bool">
      Checks if the file is likely a raster image based on its extension.

      Supports common formats: `jpg`, `jpeg`, `png`, `gif`, `bmp`, `webp`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('profile.JPG').isImage); // true
      ```
    </ResponseField>

    <ResponseField name="isAudio" type="bool">
      Checks if the file is likely an audio file.

      Supports common formats: `mp3`, `wav`, `aac`, `flac`, `m4a`, `ogg`, `wma`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('music.mp2').isAudio); // true
      ```
    </ResponseField>

    <ResponseField name="isVideo" type="bool">
      Checks if the file is likely a video file.

      Supports common formats: `mp4`, `mkv`, `mov`, `avi`, `webm`, `wmv`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('clip.mp4').isVideo); // true
      ```
    </ResponseField>

    <ResponseField name="isDocument" type="bool">
      Checks if the file is a general-purpose document, covering text, office, and PDF formats.

      This is a broad check, combining the extensions from `isTextDocument`, `isSpreadsheet`, and `isPresentation`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('docs.xlsx').isDocument); // true
      ```
    </ResponseField>

    <ResponseField name="isPresentation" type="bool">
      Checks if the file is a presentation file format.

      Supports common formats: `ppt`, `pptx`, `key`, `odp`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('docs.ppt').isPresentation); // true
      ```
    </ResponseField>

    <ResponseField name="isSpreadsheet" type="bool">
      Checks if the file is a spreadsheet file format.

      Supports common formats: `xls`, `xlsx`, `csv`, `ods` and more.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('docs.csv').isSpreadsheet); // true
      ```
    </ResponseField>

    <ResponseField name="isTextDocument" type="bool">
      Checks if the file is a general text or readable document file (PDF, Word, Markdown, etc.).

      Supports common formats: `pdf`, `doc`, `docx`, `txt` and more.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('sampleTextFile.txt').isTextDocument); // true
      ```
    </ResponseField>

    <ResponseField name="isExecutable" type="bool">
      Checks if the file is likely an executable or system binary file.

      Supports common formats: `exe`, `apk`, `aab`, `dmg`, `bat`, `sh`, `bin`, `iso`, `msi`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('ExeFile.exe').isExecutable); // true
      ```
    </ResponseField>

    <ResponseField name="isCode" type="bool">
      Checks if the file is a source code, markup, or configuration file.

      Supports common formats: `dart`, `js`, `ts`, `py`, `java`, `kt`, `swift`, `c`, `cpp`, `html`, `css`, `json`, `xml`, `yaml`, `yml`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('sampleFile.java').isCode); // true
      ```
    </ResponseField>

    <ResponseField name="isArchive" type="bool">
      Checks if the file is an archive (compressed folder).

      Supports common formats: `zip`, `rar`, `7z`, `tar`, `gz`, `bz2`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('sampleFile.rar').isArchive); // true
      ```
    </ResponseField>

    <ResponseField name="isVector" type="bool">
      Checks if the file is a vector graphic or design file.

      Supports common formats: `svg`, `ai`, `eps`, `fig`, `psd`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('sampleFile.psd').isVector); // true
      ```
    </ResponseField>

    <ResponseField name="isHidden" type="bool">
      Checks if the file is hidden, based on the Unix convention of starting the filename with a dot (.).

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(File('.htaccess').isHidden); // true
      ```
    </ResponseField>
  </Step>
</Steps>
