heyinsight_package 1.1.4 copy "heyinsight_package: ^1.1.4" to clipboard
heyinsight_package: ^1.1.4 copied to clipboard

This is package for heyinsight with notification features. @HeySheep

example/lib/main.dart

import 'package:example/screens/detail.dart';
import 'package:example/screens/home.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:heyinsight_package/heyinsight_package.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  HSNotification.initApp(
    android: HsAppOptions(
      apiKey: '',
      appId: '',
    ),
    ios: HsAppOptions(
      apiKey: '',
      appId: '',
    ),
  ); // Initialize MessagingService to handle notifications

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return HsAnalyticsProvider(builder: (context) {
      return MaterialApp.router(
        routerConfig: _router,
      );
    });
  }
}

final GoRouter _router = GoRouter(
  routes: <RouteBase>[
    GoRoute(
      path: '/',
      builder: (BuildContext context, GoRouterState state) {
        return HomeScreen();
      },
      routes: <RouteBase>[
        GoRoute(
          path: 'details',
          builder: (BuildContext context, GoRouterState state) {
            return const DetailsScreen();
          },
        ),
      ],
    ),
  ],
);