- Migrate SessionClosureBloc → SessionClosureNotifier (@riverpod) - Migrate PairingBloc → PairingNotifier (@riverpod, WebSocket + timer) - Migrate ChatBloc → ChatNotifier (@riverpod, WebSocket + message state) - Remove all flutter_bloc usage from client_app screens and main.dart - MultiBlocProvider fully removed from client_app - All screens now use ConsumerWidget/ConsumerStatefulWidget + ref Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
52 lines
1.5 KiB
Dart
52 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import '../../../core/pairing/pairing_notifier.dart';
|
|
|
|
class BestieFoundScreen extends ConsumerWidget {
|
|
final String sessionId;
|
|
final String mitraName;
|
|
|
|
const BestieFoundScreen({
|
|
super.key,
|
|
required this.sessionId,
|
|
required this.mitraName,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
ref.listen(pairingProvider, (prev, next) {
|
|
if (next is PairingActiveData) {
|
|
context.go('/chat/session/${next.sessionId}', extra: next.mitraName);
|
|
}
|
|
});
|
|
|
|
return Scaffold(
|
|
body: Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(32),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
const Icon(Icons.check_circle, size: 80, color: Colors.green),
|
|
const SizedBox(height: 24),
|
|
const Text(
|
|
'Bestie ditemukan!',
|
|
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
|
),
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
'Menghubungkan kamu ke $mitraName',
|
|
textAlign: TextAlign.center,
|
|
style: const TextStyle(fontSize: 16, color: Colors.grey),
|
|
),
|
|
const SizedBox(height: 24),
|
|
const CircularProgressIndicator(),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|