Files
buzz/mobile/lib/main.dart
Tom Brow d69b89c43c feat: add internal iOS push MVP
Signed-off-by: Tom Brow <tomb@squareup.com>
2026-08-18 16:23:53 -07:00

30 lines
916 B
Dart

import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'app.dart';
import 'shared/push/push_bootstrap.dart';
import 'shared/push/push_capability.dart';
import 'shared/push/push_bridge.dart';
import 'shared/theme/theme_provider.dart';
void main() => runBuzzApp(const App());
Future<void> runBuzzApp(Widget app) async {
WidgetsFlutterBinding.ensureInitialized();
if (buzzPushCapabilityEnabled) {
installBuzzPushMethodHandler();
await syncPendingBuzzPushNotificationResponse();
}
// Pre-load preferences so the first frame uses the saved theme/accent.
final prefs = await SharedPreferences.getInstance();
runApp(
ProviderScope(
overrides: [savedPrefsProvider.overrideWithValue(prefs)],
child: buzzPushCapabilityEnabled ? BuzzPushBootstrap(child: app) : app,
),
);
}