flutter_inapp_devtools 0.1.3
flutter_inapp_devtools: ^0.1.3 copied to clipboard
Monitor all network requests, analytics events, and debugging logs in real-time, directly inside your app.
Monitor network requests, analytics events, and logs inside your app.
π Quickstart #
void main() {
NetworkTool.ensureInitialized();
//...your code here
runApp(InAppDevTools(child: MyApp()));
}
//That's all for quickstart
π₯ Tools #
This package comes with 3 tools out of the box.
1. π Network Tool #
Monitor http network calls. No additional setup required.
What details are shown?
- Request URL, method, headers, body
- Response status, headers, body, size and time taken
By default the body is rendered as plain text or image.
You can customize how the body data is rendered by passing a list of DataPreviewExtensions to the NetworkTool.
Some extensions are provided for common data types:
- JSON Beautifier - iad_json_data_preview
- HTML Viewer - iad_html_data_preview
Usage:
import 'package:iad_json_data_preview/iad_json_data_preview.dart';
import 'package:iad_html_data_preview/iad_html_data_preview.dart';
//...
void main() {
NetworkTool.ensureInitialized();
//...your code here
runApp(InAppDevTools(
tools: [
NetworkTool(
dataPreviewExtensions: [
IadJsonDataPreview(),
IadHtmlDataPreview(),
],
),
//...other tools here
],
child: MyApp()));
}
2. π Logging Tool #
Monitor logs logged by package:logging. How to log?
final log = Logger('PaymentService');
log.shout("Payment failed");
//Methods supported:
//- `shout`
//- `severe`
//- `warning`
//- `info`
//- `config`
//- `fine`
//- `finer`
//- `finest`
3. π Analytics Tool #
Monitor analytics events.
//Usage:
AnalyticsProfiler.instance.logEvent('purchase_clicked');
//Methods supported:
//- `logEvent`
//- `logScreenView`
//- `setUserId`
//- `setUserProperty`
//- `setGlobalParameters`
N. π§ Custom Tool #
You can build your own custom tool and pass it to InAppDevTools widget.
Use cases could be - switching between dev/prod environments, performing some action to reproduce some testing scenario etc.
Limitations #
- Network logging - Only HTTP network calls are supported.
Roadmap #
- Copy feature improvements
- Filters improvement - Control what data to be seen in the list
- Stats - Data usage, Analytics count etc
- Support for CronetClient and CupertinoClient based on demand (NetworkTool)
- Want us to prioritize something that improves your or your teamβs productivity? Raise a request on GitHub Issues β weβd be happy to solve it.