import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_application_1/widgets/milestone_timeline_widget.dart'; // Widget für die Seite, die die Meilenstein-Timeline anzeigt class MilestonePage extends StatelessWidget { final String compoundInterest; // Gesamte zusammengesetzte Zinsen final String investedMoney; // Gesamte investierte Geldmenge final List> milestoneList; // Liste von Meilensteinen const MilestonePage({ super.key, required this.compoundInterest, required this.investedMoney, required this.milestoneList, }); @override Widget build(BuildContext context) { return Scaffold( body: CustomScrollView( slivers: [ SliverToBoxAdapter( child: Container( padding: EdgeInsets.only(left: 10, right: 10, top: MediaQuery.of(context).padding.top + 10), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: const Icon(CupertinoIcons.chevron_left, size: 15), onPressed: () { Navigator.pop(context); // Zurück zur vorherigen Seite }, ), Text( AppLocalizations.of(context)!.milestones, style: const TextStyle(fontWeight: FontWeight.bold), ), const SizedBox(width: 40), ], ), ), ), // Anzeige der Meilenstein-Timeline SliverToBoxAdapter( child: Padding( padding: const EdgeInsets.all(10.0), child: MilestoneTimeline(milestones: milestoneList, totalInterest: double.parse(compoundInterest) - double.parse(investedMoney)), ), ), ], ), ); } }