feat(App): update Finlytic Flutter app UI and blocs

This commit is contained in:
2026-08-09 21:01:46 +02:00
parent e7427b7464
commit a708d2977c
591 changed files with 1095105 additions and 0 deletions
@@ -0,0 +1,40 @@
import 'dart:async';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:finlytic_app/features/asset_detail/repositories/asset_repository.dart';
import 'asset_detail_event.dart';
import 'asset_detail_state.dart';
class AssetDetailBloc extends Bloc<AssetDetailEvent, AssetDetailState> {
final AssetRepository repository;
AssetDetailBloc({required this.repository}) : super(AssetDetailInitial()) {
on<LoadAssetData>(_onLoadAssetData);
on<ForceRefreshAssetData>(_onForceRefreshAssetData);
}
Future<void> _onLoadAssetData(LoadAssetData event, Emitter<AssetDetailState> emit) async {
emit(AssetDetailLoading());
try {
final results = await Future.wait([
repository.getFundamentalData(event.symbol),
repository.getTechnicalAnalysis(event.symbol),
]);
emit(AssetDetailLoaded(
fundamentalData: results[0] as dynamic,
technicalAnalysis: results[1] as dynamic,
));
} catch (e) {
emit(AssetDetailError("Fehler beim Laden der Asset-Daten."));
}
}
Future<void> _onForceRefreshAssetData(ForceRefreshAssetData event, Emitter<AssetDetailState> emit) async {
try {
await repository.forceRefreshFundamentalData(event.symbol);
// Optional: re-load after a delay, or rely on MQTT/SignalR to push the new data.
} catch (e) {
// ignore
}
}
}