StubOfflineFirstRestResponse.fromFile constructor

StubOfflineFirstRestResponse.fromFile(
  1. String filePath, {
  2. required String endpoint,
  3. StubHttpMethod? method,
})

Implementation

factory StubOfflineFirstRestResponse.fromFile(
  String filePath, {
  required String endpoint,
  StubHttpMethod? method,
}) {
  final apiFile = File(p.join(currentDirectory, filePath));
  return StubOfflineFirstRestResponse(
    apiFile.readAsStringSync(),
    endpoint: endpoint,
    method: method,
  );
}