glanzlicht / Meinweimar_Tourguide

Intelligenter Tourguide für Weimar

Verified secure showcase
167 Files 833 KB Public size 12 Redacted Dart · Markdown · YAML · HTML · JSON · GITIGNORE

Project overview

Meinweimar_Tourguide is a verified code showcase with 167 visible project entries across 5 top-level modules. The primary detected language is Dart; protected files remain visible in the structure while their contents stay private.

README

MeinWeimar Tourguide

MeinWeimar Tourguide

Eine produktionsnahe Flutter-App fuer Stadtentdeckung, Tourplanung und Sprachlernen in Weimar. Die App verbindet eine responsive mobile und webfaehige Oberflaeche mit einer WordPress-REST-API und macht aus redaktionellen Inhalten konkrete Wege, Orte und Empfehlungen.

Dieses Repository zeigt neben der UI auch die technische Produktarbeit dahinter: API-Integration, Offline-tolerante Datenhaltung, Lokalisierung, Routing, Audio/TTS, Analytics, Deep Links und automatisierte Qualitaetssicherung.

App-Eindruecke

Start · Entdecken · Touren · Karte · Mehr

Produktumfang

  • Entdecken: POIs, Touren, Veranstaltungen, Partner und Themen mit Suche,
  • Filtern und fehlertoleranter Trefferlogik.

  • Unterwegs: Kartenansicht, Standort, Fussgaenger-Routing, Tourfortschritt,
  • Favoriten und eine persoenliche Route aus der eigenen Weimar-Liste.

  • Mehrsprachigkeit: UI und CMS-Inhalte in Deutsch, Englisch,
  • Niederlaendisch, Franzoesisch, Polnisch, Italienisch, Spanisch und Tschechisch.

  • Audio und Lernen: Guide-Audio, Flutter TTS sowie SprachGuide-Kurse und
  • Lern-Touren.

  • Redaktion und Betrieb: WordPress REST API, Oeffnungszeiten mit
  • Zeitzonenlogik, Kampagnen, Partnerplatzierungen, Deep Links und First-Party- Analytics.

  • Responsive UX: kleine Displays, grosse Systemschrift, dynamische
  • Kartenhoehen und versionierte Web-Releases ohne veraltete Service-Worker- Assets.

Technischer Steckbrief

BereichUmsetzung
FrameworkFlutter / Dart 3.4+
PlattformeniOS, Android und Web
DatenWordPress REST API, typisierte Models und Repositories
Kartenflutter_map, latlong2, Standort und Fussgaenger-Routing
Audiojust_audio, flutter_tts
Lokaler ZustandShared Preferences, begrenztes Caching und Analytics-Puffer
QualitaetFlutter Analyzer, Widget- und Service-Tests, Lokalisierungs- und API-Modelltests

Die Codebasis ist nach Verantwortlichkeiten gegliedert:

lib/
	core/          gemeinsame API-, Lokalisierungs- und Navigationslogik
	data/          Datenzugriff und DTO-nahe Strukturen
	features/      produktbezogene Screens und Flows
	models/        fachliche Modelle
	repositories/  Datenzugriff hinter stabilen Schnittstellen
	services/      Routing, Audio, Analytics und Plattformdienste
	widgets/       wiederverwendbare UI-Bausteine
test/            fokussierte Tests fuer Services, Modelle und Widgets

Lokal starten

Voraussetzungen: aktuelles Flutter SDK und das darin enthaltene Dart SDK.

flutter pub get
flutter analyze
flutter test
flutter run -d chrome

Die Anwendung verwendet standardmaessig die oeffentliche API: https://tour.meinweimar.de/wp-json/meinweimar/v1

Web-Release

Fuer einen Web-Release das versionierte Build-Skript verwenden:

./tool/build_web_release.sh

Das Skript legt den Runtime-Build unter build/web/releases/<release-id>/ ab. Launcher und Versionsendpunkt bleiben bewusst nicht cachebar, damit Browser nach einem Reload die aktuelle Version auflosen. Startup-Diagnostik ist nur mit ?mwdebug=1 aktiv.

Dokumentation

  • [Deep Links](DEEP_LINKS.md) - Web-Routen fuer Bereiche, Touren und POIs
  • [Projektstatus](PROJECT_STATE.md) - aktueller Funktions- und Integrationsstand
  • [Changelog](CHANGELOG.md) - nachvollziehbare Produkt- und UX-Iterationen
  • [API-Integration](docs/API_INTEGRATION.md) - technische Integrationsnotizen
lib/features/partners/sponsor_locations_page.dartDart
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
import '../../core/localization/app_localizations.dart';
import '../../core/theme/app_colors.dart';
import '../../data/app_data_scope.dart';
import '../../data/location_scope.dart';
import '../../models/ad_campaign.dart';
import '../../models/pedestrian_route.dart';
import '../../models/sponsor_location.dart';
import '../../services/analytics_service.dart';
import '../../services/external_link_service.dart';
import '../../services/external_navigation_service.dart';
import '../../services/routing_service.dart';
import '../../widgets/opening_hours.dart';
class SponsorLocationsPage extends StatefulWidget {
const SponsorLocationsPage({super.key, required this.campaign});
final AdCampaign campaign;
@override
State<SponsorLocationsPage> createState() => _SponsorLocationsPageState();
}
class _SponsorLocationsPageState extends State<SponsorLocationsPage> {
final MapController _mapController = MapController();
final RoutingService _routingService = const RoutingService();
List<SponsorLocation> _items = const [];
SponsorLocation? _selected;
PedestrianRoute? _route;
bool _loading = true;
bool _routing = false;
String? _error;
@override
void initState() {
super.initState();
AnalyticsService.instance.track('sponsor_locations_open', properties: {
'campaign_id': widget.campaign.id,
if (widget.campaign.locationPartnerId != null)
'partner_id': widget.campaign.locationPartnerId,
});
WidgetsBinding.instance.addPostFrameCallback((_) => _load());
}
Future<void> _load() async {
try {
final items = await AppDataScope.read(context).sponsorLocations(
campaignId: widget.campaign.id,
partnerId: widget.campaign.locationPartnerId,
);
if (!mounted) return;
setState(() {
_items = items;
_selected = items.isEmpty ? null : items.first;
_loading = false;
});
if (items.isNotEmpty) {
_fit(items.map((e) => LatLng(e.latitude, e.longitude)).toList());
}
} catch (_) {
if (!mounted) return;
setState(() {
_loading = false;
_error = AppLocalizations.of(context).t('sponsorLocationsLoadError');
});
}
}
void _fit(List<LatLng> points) {
if (points.isEmpty) return;
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
try {
if (points.length == 1) {
_mapController.move(points.first, 16.2);
} else {
_mapController.fitCamera(CameraFit.coordinates(
coordinates: points,
padding: const EdgeInsets.fromLTRB(36, 36, 36, 70),
maxZoom: 16.8,
));
}
} catch (_) {}
});
}
Future<void> _routeTo(SponsorLocation location) async {
final from = LocationScope.read(context).position;
if (from == null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content:
Text(AppLocalizations.of(context).t('locationNowUnavailable'))),
);
return;
}
final lang = Localizations.localeOf(context).languageCode;
setState(() {
_routing = true;
_route = null;
});
await AnalyticsService.instance
.track('sponsor_location_route_start', properties: {
'campaign_id': widget.campaign.id,
'sponsor_location_id': location.id,
if (location.partnerId != null) 'partner_id': location.partnerId,
});
try {
final route = await _routingService.pedestrianRoute(
[from, LatLng(location.latitude, location.longitude)],
languageCode: lang,
);
if (!mounted) return;
setState(() {
_route = route;
_routing = false;
_selected = location;
});
_fit(route.geometry);
await AnalyticsService.instance
.track('sponsor_location_route_success', properties: {
'campaign_id': widget.campaign.id,
'sponsor_location_id': location.id,
'duration_minutes': route.durationMinutes,
'distance_meters': route.distanceMeters.round(),
});
} catch (_) {
if (!mounted) return;
setState(() => _routing = false);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(AppLocalizations.of(context).t('routeLoadFailed'))),
);
}
}
void _select(SponsorLocation location) {
setState(() {
_selected = location;
_route = null;
});
_mapController.move(LatLng(location.latitude, location.longitude), 16.3);
AnalyticsService.instance.track('sponsor_location_open', properties: {
'campaign_id': widget.campaign.id,
'sponsor_location_id': location.id,
if (location.partnerId != null) 'partner_id': location.partnerId,
'location_type': location.type,
});
}
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
final title = widget.campaign.utilityTitle.trim().isNotEmpty
? widget.campaign.utilityTitle
: l10n.t('sponsorLocationsTitle');
final subtitle = widget.campaign.utilityText.trim();
final user = LocationScope.of(context).position;
final routePoints = _route?.geometry ?? const <LatLng>[];
return Scaffold(
appBar: AppBar(
title:
Text(title, style: const TextStyle(fontWeight: FontWeight.w900))),
body: _loading
? const Center(child: CircularProgressIndicator())
: _error != null
? Center(
child: Padding(
padding: const EdgeInsets.all(24),
child: Text(_error!, textAlign: TextAlign.center)))
: _items.isEmpty
? Center(child: Text(l10n.t('sponsorLocationsEmpty')))
: ListView(
padding: const EdgeInsets.fromLTRB(16, 14, 16, 30),
children: [
if (subtitle.isNotEmpty) ...[
Text(subtitle,
style: const TextStyle(
color: AppColors.mutedInk, height: 1.4)),
const SizedBox(height: 14),
],
SizedBox(
height: 340,
child: ClipRRect(
borderRadius: BorderRadius.circular(22),
child: FlutterMap(
mapController: _mapController,
options: MapOptions(
initialCenter: LatLng(_items.first.latitude,
_items.first.longitude),
initialZoom: 14.5,
minZoom: 11,
maxZoom: 19,
),
children: [
TileLayer(
urlTemplate:
'https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
userAgentPackageName:
'de.meinweimar.cityguide',
),
if (routePoints.length > 1)
PolylineLayer(polylines: [
Polyline(
points: routePoints,
strokeWidth: 7,
color: AppColors.heartRed,
borderStrokeWidth: 3,
borderColor: Colors.white,
),
]),
MarkerLayer(markers: [
for (final item in _items)
Marker(
point:
LatLng(item.latitude, item.longitude),
width: 46,
height: 46,
child: GestureDetector(
onTap: () => _select(item),
child: Container(
decoration: BoxDecoration(
color: _selected?.id == item.id
? AppColors.ink
: AppColors.heartRed,
shape: BoxShape.circle,
border: Border.all(
color: Colors.white, width: 3),
),
child: Icon(_icon(item.type),
color: Colors.white, size: 22),
),
),
),
if (user != null)
Marker(
point: user,
width: 38,
height: 38,
child: const Icon(
Icons.my_location_rounded,
color: AppColors.ink,
size: 30),
),
]),
RichAttributionWidget(attributions: const [
TextSourceAttribution(
'© OpenStreetMap contributors · © CARTO')
]),
],
),
),
),
if (_selected != null) ...[
const SizedBox(height: 14),
_SelectedLocationCard(
location: _selected!,
campaignId: widget.campaign.id,
routing: _routing,
route: _route,
onRoute: () => _routeTo(_selected!),
),
],
const SizedBox(height: 20),
Text(l10n.t('sponsorLocationsAll'),
style: Theme.of(context)
.textTheme
.titleLarge
?.copyWith(fontWeight: FontWeight.w900)),
const SizedBox(height: 10),
for (final item in _items) ...[
_LocationListTile(
location: item,
selected: _selected?.id == item.id,
onTap: () => _select(item)),
const SizedBox(height: 9),
],
],
),
);
}
static IconData _icon(String type) => switch (type) {
'atm' => Icons.local_atm_rounded,
'branch' => Icons.account_balance_rounded,
'self_service' => Icons.credit_card_rounded,
_ => Icons.location_on_rounded,
};
}
class _SelectedLocationCard extends StatelessWidget {
const _SelectedLocationCard(
{required this.location,
required this.campaignId,
required this.routing,
required this.route,
required this.onRoute});
final SponsorLocation location;
final String campaignId;
final bool routing;
final PedestrianRoute? route;
final VoidCallback onRoute;
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: AppColors.line)),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
OpeningStatusBadge(openingHours: location.openingHours),
if (location.openingHours?.trim().isNotEmpty == true)
const SizedBox(height: 10),
Text(location.title,
style: const TextStyle(fontWeight: FontWeight.w900, fontSize: 18)),
const SizedBox(height: 4),
Text(_typeLabel(l10n, location.type),
style: const TextStyle(color: AppColors.mutedInk)),
if (location.address?.trim().isNotEmpty == true) ...[
const SizedBox(height: 8),
Text(location.address!)
],
if (route != null) ...[
const SizedBox(height: 8),
Text(
l10n.tf('sponsorRouteSummary', {
'distance': _distance(route!.distanceMeters),
'minutes': route!.durationMinutes
}),
style: const TextStyle(fontWeight: FontWeight.w800)),
],
const SizedBox(height: 12),
FilledButton.icon(
onPressed: routing ? null : onRoute,
icon: routing
? const SizedBox(
width: 17,
height: 17,
child: CircularProgressIndicator(
strokeWidth: 2, color: Colors.white))
: const Icon(Icons.directions_walk_rounded),
label: Text(l10n.t('routeHere')),
),
const SizedBox(height: 6),
OutlinedButton.icon(
onPressed: () {
AnalyticsService.instance
.track('sponsor_location_navigation_open', properties: {
'campaign_id': campaignId,
'sponsor_location_id': location.id,
if (location.partnerId != null) 'partner_id': location.partnerId,
});
ExternalNavigationService.navigateTo(
latitude: location.latitude,
longitude: location.longitude,
label: location.title,
);
},
icon: const Icon(Icons.navigation_outlined),
label: Text(l10n.t('sponsorOpenNavigation')),
),
if (location.website?.trim().isNotEmpty == true) ...[
const SizedBox(height: 6),
TextButton.icon(
onPressed: () {
AnalyticsService.instance.track('sponsor_location_website_click',
properties: {
'campaign_id': campaignId,
'sponsor_location_id': location.id
});
const ExternalLinkService().open(location.website!);
},
icon: const Icon(Icons.open_in_new_rounded),
label: Text(l10n.t('openWebsite')),
),
],
const SizedBox(height: 8),
OpeningHoursSection(openingHours: location.openingHours),
]),
);
}
static String _distance(double meters) => meters < 1000
? '${meters.round()} m'
: '${(meters / 1000).toStringAsFixed(1)} km';
static String _typeLabel(AppLocalizations l10n, String type) =>
switch (type) {
'atm' => l10n.t('sponsorLocationAtm'),
'branch' => l10n.t('sponsorLocationBranch'),
'self_service' => l10n.t('sponsorLocationSelfService'),
_ => l10n.t('sponsorLocationOther'),
};
}
class _LocationListTile extends StatelessWidget {
const _LocationListTile(
{required this.location, required this.selected, required this.onTap});
final SponsorLocation location;
final bool selected;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
return Material(
color: selected ? AppColors.softPink : Colors.white,
borderRadius: BorderRadius.circular(17),
child: InkWell(
borderRadius: BorderRadius.circular(17),
onTap: onTap,
child: Container(
padding: const EdgeInsets.all(13),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17),
border: Border.all(
color: selected ? AppColors.heartRed : AppColors.line)),
child: Row(children: [
Icon(_SponsorLocationsPageState._icon(location.type),
color: AppColors.heartRed),
const SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(location.title,
style: const TextStyle(fontWeight: FontWeight.w900)),
if (location.address?.trim().isNotEmpty == true)
Text(location.address!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: AppColors.mutedInk, fontSize: 12)),
])),
const Icon(Icons.chevron_right_rounded),
]),
),
),
);
}
}

Architecture

High-level modules detected from the verified public snapshot. Protected implementation details are intentionally omitted.

libmodule
testmodule
docsmodule
webmodule
toolmodule

Technology stack

DartMarkdownLOCKHTMLShellHTACCESSFlutter / Dart
Dart89.9%
Markdown3.9%
LOCK3.1%
HTML1.7%
Shell0.8%
HTACCESS0.2%
YAML0.1%
METADATA0.1%