import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'app.dart'; import 'core/utils/shared_preferences_provider.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); final prefs = await SharedPreferences.getInstance(); runApp( ProviderScope( // Riverpod 3's container-wide default auto-retries any failed // provider a handful of times with exponential backoff. This app // already has its own deliberate refresh model (manual pull + // PollingMixin for the two screens that need a timer), so the // blanket default just adds a second, invisible retry loop behind // every failed request — surprising, and it visibly fights the // explicit one on a persistently-unreachable connection. Disabled // here; opt back in per-provider with `@Riverpod(retry: ...)` if a // specific one ever wants it. retry: (retryCount, error) => null, overrides: [sharedPreferencesProvider.overrideWithValue(prefs)], child: const App(), ), ); }