refactor: perf improvements
This commit is contained in:
@@ -34,8 +34,8 @@ class ConnectivityService {
|
||||
_checkConnectivity();
|
||||
});
|
||||
|
||||
// Check every 5 seconds
|
||||
_connectivityTimer = Timer.periodic(const Duration(seconds: 5), (_) {
|
||||
// Check periodically; balance responsiveness with battery/network usage
|
||||
_connectivityTimer = Timer.periodic(const Duration(seconds: 10), (_) {
|
||||
_checkConnectivity();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -106,8 +106,16 @@ class _ErrorBoundaryState extends ConsumerState<ErrorBoundary> {
|
||||
}
|
||||
|
||||
// Default error UI
|
||||
// Respect ambient text direction when available; fall back to LTR.
|
||||
TextDirection direction;
|
||||
try {
|
||||
direction = Directionality.of(context);
|
||||
} catch (_) {
|
||||
direction = TextDirection.ltr;
|
||||
}
|
||||
|
||||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
textDirection: direction,
|
||||
child: Scaffold(
|
||||
backgroundColor: context.conduitTheme.surfaceBackground,
|
||||
body: SafeArea(
|
||||
|
||||
Reference in New Issue
Block a user