2024-06-12 12:48:30 +02:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2024-06-14 15:54:55 +02:00
|
|
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
2024-06-12 12:48:30 +02:00
|
|
|
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<Map<String, dynamic>> 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: <Widget>[
|
|
|
|
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
|
|
|
|
},
|
|
|
|
),
|
2024-06-14 15:54:55 +02:00
|
|
|
Text(
|
|
|
|
AppLocalizations.of(context)!.milestones,
|
|
|
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
2024-06-12 12:48:30 +02:00
|
|
|
),
|
|
|
|
const SizedBox(width: 40),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// Anzeige der Meilenstein-Timeline
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
2024-06-15 13:35:59 +02:00
|
|
|
child: MilestoneTimeline(milestones: milestoneList, totalInterest: (double.parse(compoundInterest) - double.parse(investedMoney)).round()),
|
2024-06-12 12:48:30 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|