Phase 3.1: Remove flutter_bloc + equatable, delete old bloc files

- Remove flutter_bloc and equatable dependencies from both apps
- Delete all 10 old bloc files (5 per app)
- Fix 6 remaining screens that used context.read<ApiClient>() from
  flutter_bloc → converted to ConsumerStatefulWidget/ConsumerWidget
  with ref.read(apiClientProvider)
- Both apps now use Riverpod exclusively for state management

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 14:12:28 +08:00
parent 35d470b851
commit fa8c963d92
20 changed files with 38 additions and 2106 deletions

View File

@@ -1,18 +1,18 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../core/api/api_client.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../../core/api/api_client_provider.dart';
import '../../../core/constants.dart';
class MitraChatTranscriptScreen extends StatefulWidget {
class MitraChatTranscriptScreen extends ConsumerStatefulWidget {
final String sessionId;
const MitraChatTranscriptScreen({super.key, required this.sessionId});
@override
State<MitraChatTranscriptScreen> createState() => _MitraChatTranscriptScreenState();
ConsumerState<MitraChatTranscriptScreen> createState() => _MitraChatTranscriptScreenState();
}
class _MitraChatTranscriptScreenState extends State<MitraChatTranscriptScreen> {
class _MitraChatTranscriptScreenState extends ConsumerState<MitraChatTranscriptScreen> {
List<Map<String, dynamic>> _messages = [];
List<Map<String, dynamic>> _closures = [];
bool _loading = true;
@@ -25,7 +25,7 @@ class _MitraChatTranscriptScreenState extends State<MitraChatTranscriptScreen> {
Future<void> _loadTranscript() async {
try {
final api = context.read<ApiClient>();
final api = ref.read(apiClientProvider);
final response = await api.get('/api/shared/chat/${widget.sessionId}/transcript');
final data = response['data'] as Map<String, dynamic>;
setState(() {