perf: defer initial data fetching to microtasks and update loading placeholders for smoother screen transitions
This commit is contained in:
@@ -45,8 +45,21 @@ class _AgentDetailScreenState extends ConsumerState<AgentDetailScreen> {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user