isValidAsync method
Returns the input
is support or not.
Implementation
@override
Future<bool> isValidAsync(AsyncImageInput input) async {
final length = await input.length;
final header = await input.getRange(
0,
simpleFileHeaderAndFooter.startBytes.length,
);
final footer = await input.getRange(
length - simpleFileHeaderAndFooter.endBytes.length,
length,
);
final headerEquals = compareTwoList(
header,
simpleFileHeaderAndFooter.startBytes,
);
final footerEquals = compareTwoList(
footer,
simpleFileHeaderAndFooter.endBytes,
);
return headerEquals && footerEquals;
}