myappcrew_flutter 0.1.5
myappcrew_flutter: ^0.1.5 copied to clipboard
MyAppCrew Flutter SDK for bootstrapping testers, tracking screens, and batching events.
MyAppCrew Flutter SDK #
Headless SDK for bootstrapping testers, tracking lifecycle/screen events, and batching events.
Minimal install (dependency + init) #
- Add dependency:
flutter pub add myappcrew_flutter
- Initialize once in
main.dart:
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await MyAppCrewFlutter.init(publicKey: 'YOUR_PUBLIC_KEY');
runApp(const MyApp());
}
Notes:
baseUrlis optional and defaults tohttps://myappcrew-tw.pages.dev.- If
publicKeyis missing, the SDK disables itself (no network calls).
Optional: screen tracking (navigator observer) #
Add the navigator observer when you want screen tracking:
final observer = MyAppCrewFlutter.navigatorObserver();
MaterialApp(
navigatorObservers: observer == null ? const [] : [observer],
home: const MyHomePage(),
);
Optional: manual connect (claim link, token, or 6-digit code) #
- Tester joins the invite in a browser.
- Copy the claim token, full claim link, or 6-digit Connect Code.
- In-app, call
connectFromText(...)(token, URL, or 6-digit code):
ElevatedButton(
onPressed: () async {
final result = await MyAppCrewFlutter.connectFromText(inputText);
if (result.connected) {
// Connected
}
},
child: const Text('Connect tester'),
);
Debugging (safe snapshot + logging) #
Read a safe snapshot that excludes secrets:
final snapshot = MyAppCrewFlutter.getDebugSnapshot();
Enable SDK logging explicitly (off by default):
MyAppCrewFlutter.setDebugLogging(true);
You can also enable logging at compile time:
flutter run --dart-define=MYAPPCREW_DEBUG_LOGS=true