Files
sharedinbox/lib/ui/screens/changelog_screen.dart
T
Thomas SharedInboxandClaude Sonnet 4.6 acd9483e8b chore: replace flutter_markdown with flutter_markdown_plus (#147)
flutter_markdown 0.7.7+1 has been discontinued in favour of
flutter_markdown_plus. Switch the dependency and update both import
sites.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 16:44:10 +02:00

48 lines
1.5 KiB
Dart

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
import 'package:url_launcher/url_launcher.dart';
class ChangeLogScreen extends StatelessWidget {
const ChangeLogScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('ChangeLog')),
body: FutureBuilder<String>(
future: rootBundle.loadString('assets/changelog.txt'),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
}
if (snapshot.hasError) {
return Center(
child: Text('Error loading changelog: ${snapshot.error}'),
);
}
final content = snapshot.data ?? 'No changelog entries found.';
return Markdown(
data: content,
onTapLink: (text, href, title) {
if (href != null) {
unawaited(
launchUrl(
Uri.parse(href),
mode: LaunchMode.externalApplication,
),
);
}
},
styleSheet: MarkdownStyleSheet(
p: const TextStyle(fontFamily: 'monospace', fontSize: 13),
),
);
},
),
);
}
}