extension property

String? get extension

Gets the file extension (without dot)

Returns the file extension or null if not found. Uses QFileInfoUtils.getExtension(path) with the dot excluded.

Example:

final file = File('/path/to/document.pdf');
print(file.extension); // "pdf"
print(file.extensionWithDot); // ".pdf"

Implementation

String? get extension => QFileInfoUtils.getExtension(path);