Flutter SDK
AllStak Flutter SDK Documentation
Weβre excited to introduce the AllStak Flutter SDK, a developer-friendly solution for error tracking and monitoring in Flutter applications.
π Key Features
β Exception Tracking
Automatically captures and reports runtime exceptions.
Provides detailed error context, including stack traces, device details, and OS information.
β Device and App Context
Collects device-specific data such as platform, OS version, and screen size.
Logs application-specific details like app version, build number, and package name.
β Network Request Monitoring
Seamlessly integrates with HTTP libraries like
http
anddio
.Tracks API requests and logs failed responses.
β Flutter Integration
Simple setup tailored for Flutter applications.
Supports Android, iOS, Web, and Desktop platforms.
π¦ Installation
Add AllStak Flutter SDK to your project by updating your pubspec.yaml
file:
dependencies:
allstak: latest_version
Then, run:
flutter pub get
π Usage
1οΈβ£ Initialize AllStak in main.dart
main.dart
import 'package:flutter/material.dart';
import 'package:allstak/allstak.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
print('Initializing AllStak SDK...');
await Allstak.init(
AllstakOptions(
apiKey: 'your-api-key-here',
environment: 'production',
),
appRunner: () => runApp(const MyApp()),
);
}
2οΈβ£ Capture Exceptions
Manually catch and log exceptions:
try {
throw Exception("Test exception for AllStak");
} catch (e, stackTrace) {
Allstak.captureException(e, stackTrace);
}
π¨ Example App
Hereβs a simple Flutter app that integrates AllStak:
import 'package:flutter/material.dart';
import 'package:allstak/allstak.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Allstak.init(
AllstakOptions(
apiKey: 'your-api-key',
environment: 'production',
),
appRunner: () => runApp(const MyApp()),
);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'AllStak Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'AllStak Error Tracking Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Future<void> _triggerError() async {
try {
throw Exception("Simulated error for AllStak");
} catch (e, stackTrace) {
Allstak.captureException(e, stackTrace);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(widget.title)),
body: Center(
child: ElevatedButton(
onPressed: _triggerError,
child: const Text("Trigger Error"),
),
),
);
}
}
π Links & Resources
π API Documentation: docs.allstak.io
π Website: allstak.io
π― What's Next?
We're continuously improving AllStak! Stay tuned for:
π Performance Monitoring
π‘ Live Issue Tracking Dashboard
Feel free to contribute and star β the repository on GitHub!
π Start Tracking Errors Like a Pro with AllStak Flutter SDK! π
Last updated