From 1cd4aebbebab257dc7006d23a9e9fde107a0e02f Mon Sep 17 00:00:00 2001 From: Herwig Birke Date: Fri, 24 Oct 2025 21:04:46 +0200 Subject: [PATCH] Import/Export --- lib/features/auth/application/splash_screen.dart | 4 ++-- lib/features/igel/data/export_service.dart | 2 +- lib/features/igel/data/igel_repository.dart | 4 ++-- lib/features/igel/domain/igel.dart | 2 +- .../igel/presentation/igel_detail_screen.dart | 16 ++++++++-------- .../igel/presentation/igel_list_screen.dart | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/features/auth/application/splash_screen.dart b/lib/features/auth/application/splash_screen.dart index a18716d..fa3387f 100644 --- a/lib/features/auth/application/splash_screen.dart +++ b/lib/features/auth/application/splash_screen.dart @@ -64,10 +64,10 @@ class _SplashState extends ConsumerState return Scaffold( body: FadeTransition( opacity: t, - child: Center( + child: const Center( child: Column( mainAxisSize: MainAxisSize.min, - children: const [ + children: [ Icon(Icons.pets, size: 96), SizedBox(height: 12), CircularProgressIndicator(), diff --git a/lib/features/igel/data/export_service.dart b/lib/features/igel/data/export_service.dart index c061795..a71e811 100644 --- a/lib/features/igel/data/export_service.dart +++ b/lib/features/igel/data/export_service.dart @@ -39,7 +39,7 @@ class IgelExportService { // Immer frisch laden final igelList = await igelRepo.list(); - final sep = ';'; + const sep = ';'; final sb = StringBuffer(); // Kopfzeile – nur Felder, die deine Models wirklich haben diff --git a/lib/features/igel/data/igel_repository.dart b/lib/features/igel/data/igel_repository.dart index c1dc904..2d89c76 100644 --- a/lib/features/igel/data/igel_repository.dart +++ b/lib/features/igel/data/igel_repository.dart @@ -19,7 +19,7 @@ class IgelRepository { DateTime? rescuedAt, String? location}) async { String? fmtDate(DateTime? d) => - d == null ? null : d.toIso8601String().split('T').first; + d?.toIso8601String().split('T').first; final res = await api.post('/igel', { 'name': name, 'note': note, @@ -53,7 +53,7 @@ class IgelRepository { DateTime? rescuedAt, String? location}) async { String? fmtDate(DateTime? d) => - d == null ? null : d.toIso8601String().split('T').first; + d?.toIso8601String().split('T').first; final body = { 'name': name, 'note': note, diff --git a/lib/features/igel/domain/igel.dart b/lib/features/igel/domain/igel.dart index 4a81dc1..d0cc005 100644 --- a/lib/features/igel/domain/igel.dart +++ b/lib/features/igel/domain/igel.dart @@ -49,7 +49,7 @@ class Igel { Map toMapForCreateUpdate() { String? fmtDate(DateTime? d) => - d == null ? null : d.toIso8601String().split('T').first; + d?.toIso8601String().split('T').first; return { 'name': name, diff --git a/lib/features/igel/presentation/igel_detail_screen.dart b/lib/features/igel/presentation/igel_detail_screen.dart index f9c06a4..19edd13 100644 --- a/lib/features/igel/presentation/igel_detail_screen.dart +++ b/lib/features/igel/presentation/igel_detail_screen.dart @@ -463,7 +463,7 @@ class _IgelDetailState extends ConsumerState { // Sicherheits-Reload der Messwerte, damit CSV aktuell ist final mw = await messRepo.list(widget.igelId); - final sep = ';'; + const sep = ';'; final sb = StringBuffer(); sb.writeln([ @@ -1384,7 +1384,7 @@ class _IgelDetailState extends ConsumerState { Text( _uploadTotal <= 1 ? 'Lade Bild hoch …' - : 'Lade Bilder hoch (${_uploadDone}/${_uploadTotal}) …', + : 'Lade Bilder hoch ($_uploadDone/$_uploadTotal) …', style: const TextStyle(color: Colors.white, fontSize: 16), ), ], @@ -1592,10 +1592,10 @@ class _WeightChartPainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { - final paddingLeft = 44.0; // Platz für Y-Labels - final paddingBottom = 28.0; // Platz für X-Labels - final paddingTop = 8.0; - final paddingRight = 12.0; + const paddingLeft = 44.0; // Platz für Y-Labels + const paddingBottom = 28.0; // Platz für X-Labels + const paddingTop = 8.0; + const paddingRight = 12.0; final area = Rect.fromLTWH( paddingLeft, @@ -1631,7 +1631,7 @@ class _WeightChartPainter extends CustomPainter { final spanG = (maxG - minG).toDouble(); // Y-Ticks (5) - final yTicks = 4; + const yTicks = 4; for (var i = 0; i <= yTicks; i++) { final ty = i / yTicks; final y = area.bottom - ty * area.height; @@ -1643,7 +1643,7 @@ class _WeightChartPainter extends CustomPainter { ); // Label final gVal = (minG + ty * spanG).round(); - _drawText(canvas, '${gVal} g', Offset(area.left - 6, y), + _drawText(canvas, '$gVal g', Offset(area.left - 6, y), align: TextAlign.right, anchor: const Offset(1, 0.5)); } diff --git a/lib/features/igel/presentation/igel_list_screen.dart b/lib/features/igel/presentation/igel_list_screen.dart index 412c096..bf23512 100644 --- a/lib/features/igel/presentation/igel_list_screen.dart +++ b/lib/features/igel/presentation/igel_list_screen.dart @@ -178,7 +178,7 @@ class _IgelListState extends ConsumerState { // Header final sb = StringBuffer(); - final sep = ';'; + const sep = ';'; sb.writeln([ // Igel-Stammdaten 'igel_id',