halkyon/halkyon_learn_flutter/test/support/fake_about_gateway.dart
Tizian 「ティツィアーン」 38843dbff2
feat(app): About Halkyon Learn, with the licences and the source
The account dialog opens Flutter's about dialog: the licences (AGPL-3.0-or-later for the app, SSPL-1.0 for the server), the address of the source the instance names, as selectable text, and "View licenses" with every package's notice, which the BSD and MIT packages require in a distributed app. The address comes through a small about feature (gateway, repository, bloc) that says so when the instance can't be reached. Tests cover the bloc both ways and the way from the account dialog; AGENTS.md records the obligation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-09-30 20:38:19 +02:00

19 lines
602 B
Dart

import 'package:halkyon_learn_flutter/src/feature/about/data/about_gateway.dart';
/// An [AboutGateway] without a server, naming [sourceCodeUrl]; [unreachable]
/// makes it fail as when the instance can't be reached.
class FakeAboutGateway({
/// Where the instance says its source is.
final String sourceCodeUrl = 'https://example.org/halkyon-learn',
}) implements AboutGateway {
/// Thrown by the next calls while set.
Exception? unreachable;
@override
Future<String> sourceCode() async {
if (unreachable case final error?) {
throw error;
}
return sourceCodeUrl;
}
}