import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'app.dart'; import 'matrix/client.dart'; import 'matrix/notifications.dart'; import 'matrix/push.dart'; import 'state.dart'; Future main(List args) async { WidgetsFlutterBinding.ensureInitialized(); // A push starts the app with this argument when it isn't running: restore // the session, show the notification, and don't start the UI. final background = args.contains('--unifiedpush-bg'); await Notifications.init(); final client = await createClient(startSync: !background); await Push.init(client); if (background) return; runApp( ProviderScope( overrides: [clientProvider.overrideWithValue(client)], child: const WarpApp(), ), ); }