Open mkhan-akhan opened 10 years ago
It was causing my style.css to be loaded as 'text/plain' which resulted in none of the styles being applied.
I have the same problem because Path.extension function
Gets the file extension of path: the portion of basename from the last
.
to the end (including the.
itself).
Opposite of mkhan-akhan solution I offer left extension names "as is" but make changes in forFile
method like that:
static ContentType forFile(File file) {
String ext = path.extension(file.path);
return _extensions[ext.length > 0 ? ext.substring(1) : ext];
}
In the Example in files.dart, ContentTypes.forFile returns null because _extensions map is missing a dot in the keys. path.extension(file.path) returns the extensions with a dot prefixed. Hence 'css' : CSS should be '.css' : CSS.