implemented the Ticker module with a native ProseMirror document renderer and integrated API support for structured content, navigation trees, and proxied files

This commit is contained in:
2026-07-09 00:51:08 +02:00
parent 1114291313
commit cedeb06569
57 changed files with 4758 additions and 43 deletions
@@ -0,0 +1,35 @@
import 'dart:typed_data';
import 'package:dio/dio.dart';
import '../../errors/marianumconnect_error.dart';
import '../../marianumconnect_api.dart';
import '../../marianumconnect_endpoint.dart';
/// Downloads the raw bytes of a PROXIED_FILE ticker page from
/// `GET /api/mobile/v1/ticker/pages/{slug}/file`.
///
/// Goes through the shared MC dio so the bearer token is attached automatically
/// (server enforces page visibility); the bytes are handed to `SfPdfViewer.memory`
/// so no auth header has to be plumbed into the viewer itself.
class GetTickerPageFile {
final String slug;
final Dio _dio;
GetTickerPageFile(this.slug, {Dio? dio})
: _dio = dio ?? MarianumConnectApi.dio();
Future<Uint8List> run() async {
try {
final response = await _dio.get<List<int>>(
MarianumConnectEndpoint.resolve(
'ticker/pages/${Uri.encodeComponent(slug)}/file',
),
options: Options(responseType: ResponseType.bytes),
);
return Uint8List.fromList(response.data!);
} on DioException catch (e) {
throw mapMarianumConnectError(e);
}
}
}