diff --git a/i18n/de.json b/i18n/de.json index caa06ba..b6b2237 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -50,7 +50,7 @@ "title": "Förderungen" }, "advisor": { - "title": "Ansprechpartner" + "title": "Berater" }, "factsheet": { "title": "Factsheet", diff --git a/lib/src/entity/measure/measure.dart b/lib/src/entity/measure/measure.dart index f5b9752..cf89aba 100644 --- a/lib/src/entity/measure/measure.dart +++ b/lib/src/entity/measure/measure.dart @@ -166,6 +166,7 @@ extension MeasureExtension on Measure { return CachedNetworkImageProvider(files![0].url!); } } + return null; } CachedNetworkImage? getFullImage() { diff --git a/lib/src/packages/ambito_theme/ambito_theme_large.dart b/lib/src/packages/ambito_theme/ambito_theme_large.dart index 667d4ce..76398d3 100644 --- a/lib/src/packages/ambito_theme/ambito_theme_large.dart +++ b/lib/src/packages/ambito_theme/ambito_theme_large.dart @@ -64,7 +64,7 @@ class AmbitoThemeLarge extends AmbitoTheme { letterSpacing: 0.1, ), labelMedium: GoogleFonts.openSans( - fontSize: 24, + fontSize: 20, height: 1.33, fontWeight: FontWeight.w500, letterSpacing: 0.15, diff --git a/lib/src/pages/actions/detail/action_detail_page.dart b/lib/src/pages/actions/detail/action_detail_page.dart index c45610b..11a9985 100644 --- a/lib/src/pages/actions/detail/action_detail_page.dart +++ b/lib/src/pages/actions/detail/action_detail_page.dart @@ -125,31 +125,31 @@ class ActionDetailPageState extends State { Expanded( child: Column(children: [ DescriptionCard( - massnahme: massnahme!, + massnahme: massnahme, ), theme.verticalSpacer, BackgroundCard( - massnahme: massnahme!, + massnahme: massnahme, ), theme.verticalSpacer, PresetsCard( - massnahme: massnahme!, + massnahme: massnahme, ), theme.verticalSpacer, BiodiverisityCard( - massnahme: massnahme!, + massnahme: massnahme, ), theme.verticalSpacer, CreationCard( - massnahme: massnahme!, + massnahme: massnahme, ), theme.verticalSpacer, MaintenanceCard( - massnahme: massnahme!, + massnahme: massnahme, ), theme.verticalSpacer, FundingCard( - massnahme: massnahme!, + massnahme: massnahme, ), theme.verticalSpacer, ]), diff --git a/lib/src/pages/actions/detail/cards/advisor_card.dart b/lib/src/pages/actions/detail/cards/advisor_card.dart index 2c243be..fe74cb4 100644 --- a/lib/src/pages/actions/detail/cards/advisor_card.dart +++ b/lib/src/pages/actions/detail/cards/advisor_card.dart @@ -1,5 +1,7 @@ import 'package:ambito/src/extensions/extensions.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_linkify/flutter_linkify.dart'; +import 'package:linkify/linkify.dart'; import '../../../../entity/entities.dart'; import '../../../../packages/ambito_theme/ambito_theme.dart'; @@ -17,10 +19,10 @@ class AdvisorCard extends StatelessWidget { width: double.infinity, child: Card( shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(0), + borderRadius: BorderRadius.circular(8), ), elevation: 0, - color: theme.currentColorScheme.tertiary, + color: greenColors['primary']!.withOpacity(.1), child: Padding( padding: const EdgeInsets.all(16), child: Column( @@ -28,12 +30,28 @@ class AdvisorCard extends StatelessWidget { children: [ Text( context.translate('page.actionDetailPage.advisor.title'), - style: theme.currentThemeData.textTheme.titleMedium, + style: theme.currentThemeData.textTheme.labelMedium + ?.copyWith(color: theme.currentColorScheme.primary), ), - theme.verticalSpacer, + theme.verticalSpacerSmall, Text( 'Max Mustermann', + style: theme.currentThemeData.textTheme.bodyMedium + ?.copyWith(fontWeight: FontWeight.bold), + ), + Linkify( + text: 'EMail: max@mustermann.de', style: theme.currentThemeData.textTheme.bodyMedium, + linkifiers: const [ + EmailLinkifier(), + ], + ), + Linkify( + text: 'Tel: +4917666554433', + style: theme.currentThemeData.textTheme.bodyMedium, + linkifiers: const [ + PhoneNumberLinkifier(), + ], ), ], ), diff --git a/lib/src/pages/actions/detail/cards/background_card.dart b/lib/src/pages/actions/detail/cards/background_card.dart index 3467077..ff188eb 100644 --- a/lib/src/pages/actions/detail/cards/background_card.dart +++ b/lib/src/pages/actions/detail/cards/background_card.dart @@ -1,4 +1,5 @@ import 'package:ambito/src/extensions/extensions.dart'; +import 'package:expansion_tile_card/expansion_tile_card.dart'; import 'package:flutter/material.dart'; import '../../../../entity/entities.dart'; @@ -15,44 +16,50 @@ class BackgroundCard extends StatelessWidget { return SizedBox( width: double.infinity, - child: Card( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(0), - ), + child: ExpansionTileCard( + initiallyExpanded: true, elevation: 0, - color: theme.currentColorScheme.secondary, - child: Padding( - padding: const EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - context.translate('page.actionDetailPage.background.title'), - style: theme.currentThemeData.textTheme.titleMedium, - ), - theme.verticalSpacer, - Text( - context.translate('page.actionDetailPage.background.areaType'), - style: theme.currentThemeData.textTheme.titleSmall, - ), - theme.verticalSpacerSmall, - Text( - massnahme.factsheetLocation.toString(), - style: theme.currentThemeData.textTheme.bodyMedium, - ), - theme.verticalSpacer, - Text( - context.translate('page.actionDetailPage.background.target'), - style: theme.currentThemeData.textTheme.titleSmall, - ), - theme.verticalSpacerSmall, - Text( - massnahme.factsheetTarget.toString(), - style: theme.currentThemeData.textTheme.bodyMedium, - ), - ], - ), + expandedTextColor: theme.currentColorScheme.outline, + baseColor: theme.currentColorScheme.secondary, + expandedColor: theme.currentColorScheme.secondary, + title: Text( + context.translate('page.actionDetailPage.background.title'), + style: theme.currentThemeData.textTheme.labelMedium, ), + children: [ + Align( + alignment: Alignment.topLeft, + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + context + .translate('page.actionDetailPage.background.areaType'), + style: theme.currentThemeData.textTheme.labelSmall, + ), + theme.verticalSpacerSmall, + Text( + massnahme.factsheetLocation.toString(), + style: theme.currentThemeData.textTheme.bodyMedium, + ), + theme.verticalSpacer, + Text( + context + .translate('page.actionDetailPage.background.target'), + style: theme.currentThemeData.textTheme.titleSmall, + ), + theme.verticalSpacerSmall, + Text( + massnahme.factsheetTarget.toString(), + style: theme.currentThemeData.textTheme.bodyMedium, + ), + ], + ), + ), + ), + ], ), ); } diff --git a/lib/src/pages/actions/detail/cards/description_card.dart b/lib/src/pages/actions/detail/cards/description_card.dart index af275d9..6b252ef 100644 --- a/lib/src/pages/actions/detail/cards/description_card.dart +++ b/lib/src/pages/actions/detail/cards/description_card.dart @@ -1,3 +1,4 @@ +import 'package:ambito/src/extensions/extensions.dart'; import 'package:expansion_tile_card/expansion_tile_card.dart'; import 'package:flutter/material.dart'; @@ -16,24 +17,29 @@ class DescriptionCard extends StatelessWidget { return SizedBox( width: double.infinity, child: ExpansionTileCard( - elevation: 0, - baseColor: theme.currentColorScheme.secondary, - title: Text( - massnahme.name ?? '', - style: theme.currentThemeData.textTheme.headlineMedium, - ), - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - theme.verticalSpacer, - Text( - massnahme.factsheetDefinition ?? '', - style: theme.currentThemeData.textTheme.bodyMedium, - ), - ], + initiallyExpanded: true, + elevation: 0, + expandedTextColor: theme.currentColorScheme.outline, + baseColor: theme.currentColorScheme.secondary, + expandedColor: theme.currentColorScheme.secondary, + title: Text( + context.translate('page.actionDetailPage.description.title'), + style: theme.currentThemeData.textTheme.labelMedium, + ), + children: [ + Align( + alignment: Alignment.topLeft, + child: Padding( + padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), + child: Text( + massnahme.factsheetDefinition ?? '', + style: theme.currentThemeData.textTheme.bodyMedium, + textAlign: TextAlign.left, + ), ), - ]), + ), + ], + ), ); } } diff --git a/lib/src/pages/actions/detail/cards/material_card.dart b/lib/src/pages/actions/detail/cards/material_card.dart index 3ce4732..00f13f3 100644 --- a/lib/src/pages/actions/detail/cards/material_card.dart +++ b/lib/src/pages/actions/detail/cards/material_card.dart @@ -17,10 +17,10 @@ class MaterialCard extends StatelessWidget { width: double.infinity, child: Card( shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(0), + borderRadius: BorderRadius.circular(8), ), elevation: 0, - color: theme.currentColorScheme.tertiary, + color: greenColors['primary']!.withOpacity(.1), child: Padding( padding: const EdgeInsets.all(16), child: Column( @@ -28,7 +28,8 @@ class MaterialCard extends StatelessWidget { children: [ Text( context.translate('page.actionDetailPage.material.title'), - style: theme.currentThemeData.textTheme.titleMedium, + style: theme.currentThemeData.textTheme.labelMedium + ?.copyWith(color: theme.currentColorScheme.primary), ), theme.verticalSpacer, _getSortedMaterials(context), diff --git a/pubspec.lock b/pubspec.lock index cd08bdf..ee9f7f3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -387,6 +387,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.36.2" + flutter_linkify: + dependency: "direct main" + description: + name: flutter_linkify + sha256: "74669e06a8f358fee4512b4320c0b80e51cffc496607931de68d28f099254073" + url: "https://pub.dev" + source: hosted + version: "6.0.0" flutter_lints: dependency: "direct dev" description: @@ -682,6 +690,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.1" + linkify: + dependency: "direct main" + description: + name: linkify + sha256: "4139ea77f4651ab9c315b577da2dd108d9aa0bd84b5d03d33323f1970c645832" + url: "https://pub.dev" + source: hosted + version: "5.0.0" lints: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a454242..c000c10 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -56,6 +56,8 @@ dependencies: screen_breakpoints: ^1.0.5 provider: ^6.1.2 expansion_tile_card: ^3.0.0 + flutter_linkify: ^6.0.0 + linkify: ^5.0.0 dev_dependencies: