perf: fix Android lag, snapping animations & slow image loading

Fix 1: Replace overshooting Cubic(1.95) tab glider curve with
  Curves.easeInOutCubic; reduce duration 450ms → 280ms
Fix 2: Replace marquee jumpTo() with animateTo(linear) for fluid scroll
Fix 3: Replace Image.network with CachedNetworkImage in search results
Fix 4: Replace Image.network with CachedNetworkImage in desktop cards
Fix 5: Wrap IndexedStack children in RepaintBoundary to isolate
  repaints across tabs (Home/Calendar/Contribute/Profile)
Fix 6: Replace setState on PageView.onPageChanged with ValueNotifier
  so only the carousel dots widget rebuilds on swipe
Fix 7: Wrap animated tab glider in RepaintBoundary
Fix 8: Replace shrinkWrap:true ListView with ConstrainedBox(maxHeight)
  to eliminate O(n) layout pass in search results
Fix 9: Increase image cache to 200MB / 500 images in main()
This commit is contained in:
2026-03-18 15:39:42 +05:30
parent 50caad21a5
commit 2aa05366ad
4 changed files with 107 additions and 51 deletions

View File

@@ -13,6 +13,11 @@ import 'core/theme_manager.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await ThemeManager.init(); // load saved theme preference
// Increase image cache for smoother scrolling and faster re-renders
PaintingBinding.instance.imageCache.maximumSize = 500;
PaintingBinding.instance.imageCache.maximumSizeBytes = 200 * 1024 * 1024; // 200 MB
runApp(const MyApp());
}