- Direct m.login.password auth against matrix.m8chat.au - Room list with unread badges, last message, timestamps - Chat timeline (text, images, files, replies, reactions) - Profile screen with expandable Notifications and Security sections - Olm E2EE initialisation (web WASM bootstrap) - Global error handler preventing Matrix SDK crashes - GoRouter with refreshListenable (no recreation on auth change) - Feature-first clean architecture: Riverpod + GoRouter + Drift - Deployed to https://app2.m8chat.au Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
962 B
Dart
28 lines
962 B
Dart
// Version: 1.0.1 | Created: 2026-04-01
|
|
// Application entry point.
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'app/app.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Catch Flutter framework errors (widget build, rendering) without crashing.
|
|
FlutterError.onError = (details) {
|
|
debugPrint('[M8Chat] Flutter error: ${details.exceptionAsString()}');
|
|
};
|
|
|
|
// Catch all unhandled async errors — including those thrown by the Matrix SDK
|
|
// in runInRoot() after login (encryption init, sync startup). Without this
|
|
// handler the browser runtime crashes and the UI freezes on the spinner.
|
|
PlatformDispatcher.instance.onError = (error, stack) {
|
|
debugPrint('[M8Chat] Uncaught error: $error');
|
|
return true; // returning true marks the error as handled
|
|
};
|
|
|
|
runApp(const ProviderScope(child: M8ChatApp()));
|
|
}
|