Implemented per stream subscription recovery with polling fallback
This commit is contained in:
@@ -13,6 +13,7 @@ import '../../providers/profile_provider.dart';
|
||||
import '../../providers/tasks_provider.dart';
|
||||
import '../../providers/tickets_provider.dart';
|
||||
import '../../widgets/responsive_body.dart';
|
||||
import '../../widgets/reconnect_overlay.dart';
|
||||
import '../../providers/realtime_controller.dart';
|
||||
import 'package:skeletonizer/skeletonizer.dart';
|
||||
import '../../theme/app_surfaces.dart';
|
||||
@@ -353,7 +354,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
|
||||
return ResponsiveBody(
|
||||
child: Skeletonizer(
|
||||
enabled: realtime.isConnecting,
|
||||
enabled: realtime.isAnyStreamRecovering,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final sections = <Widget>[
|
||||
@@ -449,43 +450,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (realtime.isConnecting)
|
||||
Positioned.fill(
|
||||
child: AbsorbPointer(
|
||||
absorbing: true,
|
||||
child: Container(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.surface.withAlpha((0.35 * 255).round()),
|
||||
alignment: Alignment.topCenter,
|
||||
padding: const EdgeInsets.only(top: 36),
|
||||
child: SizedBox(
|
||||
width: 280,
|
||||
child: Card(
|
||||
elevation: 4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: const [
|
||||
SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text('Reconnecting realtime…'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (realtime.isAnyStreamRecovering)
|
||||
const Positioned(
|
||||
bottom: 16,
|
||||
right: 16,
|
||||
child: ReconnectIndicator(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user