56 lines
1.9 KiB
Dart
56 lines
1.9 KiB
Dart
|
import 'package:flutter/cupertino.dart';
|
||
|
import 'package:flutter/material.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<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
|
||
|
},
|
||
|
),
|
||
|
const Text(
|
||
|
'Meilensteine',
|
||
|
style: 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)),
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|