stubJsonFileImpl function
Implementation for native platforms (mobile, desktop, server)
This provides file operations that require dart:io.
Implementation
Future<JokerStub> stubJsonFileImpl({
String? host,
String? path,
String? method,
required String filePath,
int statusCode = 200,
Map<String, String> headers = const {},
Duration? delay,
String? name,
bool removeAfterUse = false,
}) async {
final response = await JokerResponseFile.jsonFile(
filePath,
statusCode: statusCode,
headers: headers,
delay: delay,
);
// Use the public stubUrl method to register the stub
return Joker.stubUrl(
host: host,
path: path,
method: method,
response: response,
name: name,
removeAfterUse: removeAfterUse,
);
}