launchSmoothApp function

Future<void> launchSmoothApp({
  1. required Scanner barcodeScanner,
  2. required AppStore appStore,
  3. required StoreLabel storeLabel,
  4. required ScannerLabel scannerLabel,
  5. bool screenshots = false,
})

Implementation

Future<void> launchSmoothApp({
  required Scanner barcodeScanner,
  required AppStore appStore,
  required StoreLabel storeLabel,
  required ScannerLabel scannerLabel,
  bool screenshots = false,
}) async {
  _screenshots = screenshots;

  GlobalVars.barcodeScanner = barcodeScanner;
  GlobalVars.appStore = appStore;
  GlobalVars.storeLabel = storeLabel;
  GlobalVars.scannerLabel = scannerLabel;

  if (_screenshots) {
    await _init1();
    runApp(const SmoothApp());
    return;
  }
  final WidgetsBinding widgetsBinding =
      WidgetsFlutterBinding.ensureInitialized();
  await RiveNative.init();
  FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);

  _enableEdgeToEdgeMode();

  if (kReleaseMode) {
    await AnalyticsHelper.initSentry(
      appRunner: () => runApp(const SmoothApp()),
    );
  } else {
    runApp(const SmoothApp());
  }
}