diff --git a/lib/features/about/presentation/screens/about_screen.dart b/lib/features/about/presentation/screens/about_screen.dart index db7369a..568b54e 100644 --- a/lib/features/about/presentation/screens/about_screen.dart +++ b/lib/features/about/presentation/screens/about_screen.dart @@ -206,7 +206,8 @@ class _AboutState { class _AboutNotifier extends StateNotifier<_AboutState> { _AboutNotifier() : super(const _AboutState()) { - _load(); + // Defer CMS fetch so the first frame paints before the HTTP request + Future.microtask(_load); } Future _load() async { @@ -304,9 +305,18 @@ class AboutScreen extends ConsumerWidget { final state = ref.watch(_aboutProvider); if (state.isLoading) { - return const Center( - child: CircularProgressIndicator( - color: AppColors.accentOrange, + // Full-size placeholder so slide-in transition doesn't pop blank + return Container( + color: Colors.white, + alignment: Alignment.topCenter, + padding: const EdgeInsets.only(top: 120), + child: const SizedBox( + width: 28, + height: 28, + child: CircularProgressIndicator( + color: AppColors.accentOrange, + strokeWidth: 2.5, + ), ), ); } diff --git a/lib/features/agents/presentation/providers/agent_detail_provider.dart b/lib/features/agents/presentation/providers/agent_detail_provider.dart index a95cc5a..337b2db 100644 --- a/lib/features/agents/presentation/providers/agent_detail_provider.dart +++ b/lib/features/agents/presentation/providers/agent_detail_provider.dart @@ -449,7 +449,10 @@ class AgentDetailNotifier extends StateNotifier { AgentDetailNotifier(this._repo, this.agentId) : super(const AgentDetailState()) { - _load(); + // Defer the network burst to the next microtask so the agent detail + // screen's first frame (loading placeholder) paints before the three + // parallel HTTP requests kick off — smoother slide-in transition. + Future.microtask(_load); // Listen for real-time connection response (accepted/rejected) _connectionResponseSub = SocketService().onConnectionResponse.listen((_) { diff --git a/lib/features/agents/presentation/screens/agent_detail_screen.dart b/lib/features/agents/presentation/screens/agent_detail_screen.dart index 1a0c71a..9735507 100644 --- a/lib/features/agents/presentation/screens/agent_detail_screen.dart +++ b/lib/features/agents/presentation/screens/agent_detail_screen.dart @@ -45,8 +45,21 @@ class _AgentDetailScreenState extends ConsumerState { final state = ref.watch(agentDetailProvider(widget.agentId)); if (state.isLoading) { - return const Center( - child: CircularProgressIndicator(color: AppColors.accentOrange), + // Full-size placeholder with the screen's base color so the slide-in + // transition doesn't pop from blank → content. Small spinner at top + // instead of centered (less attention-grabbing during navigation). + return Container( + color: Colors.white, + alignment: Alignment.topCenter, + padding: const EdgeInsets.only(top: 120), + child: const SizedBox( + width: 28, + height: 28, + child: CircularProgressIndicator( + color: AppColors.accentOrange, + strokeWidth: 2.5, + ), + ), ); } if (state.error != null) { diff --git a/lib/features/faq/presentation/screens/faq_screen.dart b/lib/features/faq/presentation/screens/faq_screen.dart index dbe6e8b..726f609 100644 --- a/lib/features/faq/presentation/screens/faq_screen.dart +++ b/lib/features/faq/presentation/screens/faq_screen.dart @@ -122,7 +122,7 @@ class FaqState { class FaqNotifier extends StateNotifier { FaqNotifier() : super(const FaqState()) { - _load(); + Future.microtask(_load); } Future _load() async {