NetLensCore class
Constructors
- NetLensCore({required NetLensConfiguration configuration})
- Creates netLens core instance
Properties
-
callsStream
→ Stream<
List< NetLensHttpCall> > -
Returns stream which returns list of HTTP calls
no setter
- configuration → NetLensConfiguration
-
Returns current configuration
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInspectorOpened → bool
-
Returns flag which determines whether inspector is opened
no setter
- mocks → NetLensMocks
-
Records calls as mock endpoints and replays them.
no setter
- redactor → NetLensCallRedactor
-
Redactor which masks sensitive values as configured.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addAdapter(
NetLensAdapter adapter) → void -
Injects this core into
adapter. An adapter which can send calls again is used to replay calls of its client. -
addCall(
NetLensHttpCall call) → FutureOr< void> - Add netLens http call to calls subject
-
addError(
NetLensHttpError error, int requestId) → FutureOr< void> - Add error to existing netLens http call
-
addLog(
NetLensLog log) → void - Adds new log to NetLens logger.
-
addLogs(
List< NetLensLog> logs) → void - Adds list of logs to NetLens logger
-
addResponse(
NetLensHttpResponse response, int requestId) → FutureOr< void> - Add response to existing netLens http call
-
canReplay(
NetLensHttpCall call) → bool -
Returns true when
callcan be sent again. -
dispose(
) → void - Dispose subjects and subscriptions
-
getCalls(
) → List< NetLensHttpCall> - Returns all stored HTTP calls.
-
getContext(
) → BuildContext? - Get context from navigator key. Used to open inspector route.
-
getReplayer(
NetLensHttpCall call) → NetLensCallReplayer? -
Returns the adapter which can send
callagain, or null when no added adapter can. - Opens Http calls inspector. This will navigate user to the new fullscreen page where all listened http calls can be viewed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeCalls(
) → FutureOr< void> - Remove all calls from calls subject
-
replay(
NetLensHttpCall call, NetLensReplayRequest request) → Future< void> -
Sends
request, which was built fromcall, again with the client which madecall. The new call is caught like any other call. -
saveCallsToFile(
BuildContext context) → Future< NetLensExportResult> - Save all calls to file. Sensitive values are masked.
-
saveCallsToHarFile(
) → Future< NetLensExportResult> - Save all calls to a HAR file. Sensitive values are masked.
-
saveMocksToCollectionFile(
) → Future< NetLensExportResult> - Saves all mocks to a Postman collection file and shares it. Sensitive request headers are masked.
-
saveMocksToFile(
) → Future< NetLensExportResult> - Saves all mocks to a file in the NetLens mocks JSON format and shares it. Sensitive request headers are masked.
-
selectCall(
int requestId) → NetLensHttpCall? -
Selects call with given
requestId. It may return null. - Set custom navigation key. This will help if there's route library.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited