feat: Initialize NetworkService in main.dart and add OfflineIndicator to HomeShell
This commit is contained in:
parent
7f618bcdf2
commit
70d4bc5140
|
|
@ -16,6 +16,7 @@ import 'services/secure_chat_service.dart';
|
|||
import 'services/simple_e2ee_service.dart';
|
||||
import 'services/key_vault_service.dart';
|
||||
import 'services/sync_manager.dart';
|
||||
import 'services/network_service.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'theme/app_theme.dart';
|
||||
import 'providers/theme_provider.dart' as theme_provider;
|
||||
|
|
@ -129,6 +130,9 @@ class _sojornAppState extends ConsumerState<sojornApp> with WidgetsBindingObserv
|
|||
if (kDebugMode) debugPrint('[APP] initState start ${DateTime.now().toIso8601String()}');
|
||||
_initDeepLinks();
|
||||
_listenForAuth();
|
||||
// Initialize network monitoring
|
||||
NetworkService().initialize();
|
||||
|
||||
if (kDebugMode) debugPrint('[APP] initState sync complete — deferring heavy init');
|
||||
// Defer heavy work with real delays to avoid jank on first paint
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import '../secure_chat/secure_chat_full_screen.dart';
|
|||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../widgets/radial_menu_overlay.dart';
|
||||
import '../../widgets/onboarding_modal.dart';
|
||||
import '../../widgets/offline_indicator.dart';
|
||||
import '../../providers/quip_upload_provider.dart';
|
||||
import '../../providers/notification_provider.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
|
@ -116,14 +117,19 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
|
|||
final currentIndex = widget.navigationShell.currentIndex;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppTheme.scaffoldBg,
|
||||
appBar: _buildAppBar(),
|
||||
body: Stack(
|
||||
body: Column(
|
||||
children: [
|
||||
NavigationShellScope(
|
||||
currentIndex: currentIndex,
|
||||
child: widget.navigationShell,
|
||||
),
|
||||
RadialMenuOverlay(
|
||||
const OfflineIndicator(),
|
||||
Expanded(
|
||||
child: Stack(
|
||||
children: [
|
||||
NavigationShellScope(
|
||||
currentIndex: currentIndex,
|
||||
child: widget.navigationShell,
|
||||
),
|
||||
RadialMenuOverlay(
|
||||
isVisible: _isRadialMenuVisible,
|
||||
onDismiss: () => setState(() => _isRadialMenuVisible = false),
|
||||
onPostTap: () {
|
||||
|
|
@ -147,6 +153,9 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
|
|||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue