feat(app): clean architecture with typed repositories, DTO models and calendar event logos
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../core/theme/app_theme.dart';
|
||||
import '../../../core/widgets/asset_logo_widget.dart';
|
||||
import '../../../core/widgets/glass_container.dart';
|
||||
import '../../../core/widgets/status_badge.dart';
|
||||
|
||||
@@ -11,11 +12,13 @@ class CalendarEventItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isin = event['isin']?.toString() ?? '';
|
||||
final symbol = event['symbol']?.toString() ?? 'ASSET';
|
||||
final company = event['companyName']?.toString() ?? symbol;
|
||||
final type = event['eventType']?.toString() ?? 'Earnings';
|
||||
final desc = event['description']?.toString() ?? '';
|
||||
final dateStr = event['eventDate']?.toString() ?? '';
|
||||
final image = event['image']?.toString() ?? (isin.isNotEmpty ? '/api/v1/logo/$isin' : null);
|
||||
|
||||
Color badgeColor = AppTheme.primaryEmerald;
|
||||
if (type == 'ExDividend') badgeColor = AppTheme.accentCyan;
|
||||
@@ -25,16 +28,11 @@ class CalendarEventItem extends StatelessWidget {
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: badgeColor.withValues(alpha: 0.15),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(
|
||||
type == 'Earnings' ? Icons.bar_chart : (type == 'ExDividend' ? Icons.content_cut : Icons.payments),
|
||||
color: badgeColor,
|
||||
),
|
||||
AssetLogoWidget(
|
||||
symbolOrName: isin.isNotEmpty ? isin : company,
|
||||
imageUrl: image,
|
||||
size: 36,
|
||||
enableHero: false,
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
Expanded(
|
||||
|
||||
@@ -68,7 +68,7 @@ class CalendarEventTile extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
AssetLogoWidget(symbolOrName: companyName, imageUrl: image, size: 28),
|
||||
AssetLogoWidget(symbolOrName: isin.isNotEmpty ? isin : companyName, imageUrl: image, size: 28, enableHero: false),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user