refactor: optimize app initialization and startup flow

- Delayed heavy provider initialization to improve initial UI responsiveness.
- Introduced a queuing mechanism for provider initialization with staggered delays.
- Updated app startup flow to ensure proper handling of mounted state during asynchronous operations.
- Enhanced socket service management and background model loading to improve app performance and reliability.
This commit is contained in:
cogwheel0
2025-10-02 21:33:58 +05:30
parent e58a6e533f
commit 5138491cfa
3 changed files with 96 additions and 26 deletions

View File

@@ -1012,20 +1012,31 @@ class _ChatPageState extends ConsumerState<ChatPage> {
),
)
.animate()
.scale(duration: const Duration(milliseconds: 300))
.fadeIn(
duration: const Duration(milliseconds: 220),
curve: Curves.easeOutCubic,
)
.then()
.shimmer(duration: const Duration(milliseconds: 1200)),
const SizedBox(height: Spacing.xl),
Text(
l10n.onboardStartTitle(greetingName),
style: theme.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w600,
color: context.conduitTheme.textPrimary,
AnimatedSwitcher(
duration: const Duration(milliseconds: 200),
switchInCurve: Curves.easeOutCubic,
switchOutCurve: Curves.easeInCubic,
transitionBuilder: (child, animation) =>
FadeTransition(opacity: animation, child: child),
child: Text(
l10n.onboardStartTitle(greetingName),
key: ValueKey<String>(greetingName),
style: theme.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w600,
color: context.conduitTheme.textPrimary,
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
).animate().fadeIn(delay: const Duration(milliseconds: 150)),
),
],
),
),