slb_dps_flutter_resuable 0.0.3
slb_dps_flutter_resuable: ^0.0.3 copied to clipboard
Reusable code for flutter applications.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:slb_dps_flutter_resuable/service/app_center_service.dart';
import 'dart:async';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
initAppCenter();
}
Future<void> initAppCenter() async {
if (!mounted) return;
AppCenterService appCenterService = AppCenterService();
await appCenterService.initAppCenter(
androidAppCenterKey: "ANDROID_APP_CENTER_KEY",
iOSAppCenterKey: "IOS_APP_CENTER_KEY");
await appCenterService.logEvent(eventName: 'Sample Event Name');
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin usage example'),
),
body: const Center(
child: Text('Running on:\n'),
),
),
);
}
}