> ## 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 - Size Check Operations

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

<Steps titleSize="h3">
  <Step title="Formatting">
    <ResponseField name="fileFormattedSize()" type="String">
      <Expandable title="Parameters">
        <ParamField body="fullySizedName" type="bool" default="false">
          If `true`, uses the full unit names (e.g., 'Kilobytes'); otherwise, uses abbreviations (e.g., 'KB').
        </ParamField>
      </Expandable>

      Retrieves the file size and formats it into human-readable units (B, KB, MB, GB).

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      final size = file.fileFormattedSize(fullySizedName: true);
      print(size); // 5.32 Megabytes
      ```
    </ResponseField>
  </Step>

  <Step title="Getters">
    <ResponseField name="sizeInBytes" type="double">
      Returns the file size in raw Bytes as a `double`.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      final size = file.sizeInBytes; // 1048576.0 for a 1MB file
      ```
    </ResponseField>

    <ResponseField name="sizeInKB" type="double">
      Returns the file size in Kilobytes (KB) as a \[double].

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(file.sizeInKB); // 1024.0 for a 1MB file
      ```
    </ResponseField>

    <ResponseField name="sizeInMB" type="double">
      Returns the file size in Megabytes (MB) as a \[double].

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(file.sizeInMB); // 1.0 for a 1MB file
      ```
    </ResponseField>

    <ResponseField name="sizeInGB" type="double">
      Returns the file size in Gigabytes (GB) as a \[double].

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(file.sizeInGB); // 0.0009765625 for a 1MB file
      ```
    </ResponseField>
  </Step>

  <Step title="Comparators">
    <ResponseField name="isLargerThanMb()" type="bool">
      <Expandable title="Parameters">
        <ParamField body="mb" type="double" required>
          The size limit in megabytes.
        </ParamField>
      </Expandable>

      Checks if the file size is strictly greater than the specified size in Megabytes (MB).

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(file.isLargerThanMb(50)); // true if file is 50.01MB
      ```
    </ResponseField>

    <ResponseField name="isSmallerThanMb()" type="bool">
      <Expandable title="Parameters">
        <ParamField body="mb" type="double" required>
          The size limit in megabytes.
        </ParamField>
      </Expandable>

      Checks if the file size is strictly less than the specified size in Megabytes (MB).

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(file.isSmallerThanMb(0.5)); // true if file is 400KB
      ```
    </ResponseField>

    <ResponseField name="isLargerThanFile()" type="bool">
      <Expandable title="Parameters">
        <ParamField body="other" type="File" required>
          The other `File` object to compare size against.
        </ParamField>
      </Expandable>

      Checks if this file is larger than another `File` object by comparing raw byte counts.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(fileA.isLargerThanFile(fileB));
      ```
    </ResponseField>

    <ResponseField name="isSmallerThanFile()" type="bool">
      <Expandable title="Parameters">
        <ParamField body="other" type="File" required>
          The other `File` object to compare size against.
        </ParamField>
      </Expandable>

      Checks if this file is smaller than another `File` object by comparing raw byte counts.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(fileA.isSmallerThanFile(fileB));
      ```
    </ResponseField>

    <ResponseField name="isSameSizeAsFile()" type="bool">
      <Expandable title="Parameters">
        <ParamField body="other" type="File" required>
          The other `File` object to compare size against.
        </ParamField>
      </Expandable>

      Checks if this file has the exact same size (byte count) as another \[File] object.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      print(fileA.isSameSizeAsFile(fileB));
      ```
    </ResponseField>

    <ResponseField name="isSizeBetween()" type="bool">
      <Expandable title="Parameters">
        <ParamField body="minMB" type="double" required>
          The minimum size limit (inclusive) in megabytes.
        </ParamField>

        <ParamField body="maxMB" type="double" required>
          The maximum size limit (inclusive) in megabytes.
        </ParamField>
      </Expandable>

      Checks if the file size falls inclusively between the specified minimum and maximum sizes in Megabytes (MB).

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      // Check if file is between 500 KB (0.5 MB) and 10 MB
      print(file.isSizeBetween(minMB: 0.5, maxMB: 10));
      ```
    </ResponseField>
  </Step>

  <Step title="Manipulators">
    <ResponseField name="percentageOfLimitMb()" type="double">
      <Expandable title="Parameters">
        <ParamField body="totalLimitMB" type="double" required>
          The total limit in Megabytes (MB).
        </ParamField>
      </Expandable>

      Calculates the file's size as a percentage of a given total size limit.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      // If file is 5MB and limit is 100MB, returns 5.0
      print(file.percentageOfLimitMb(100));
      ```
    </ResponseField>
  </Step>
</Steps>
