Flutter-Ernaehrungsapp/lib/web/component/header_component.dart

36 lines
918 B
Dart
Raw Normal View History

2023-05-29 12:08:46 +02:00
import 'package:ernaehrung/web/component/header_button_component.dart';
import 'package:flutter/cupertino.dart';
class HeaderComponentWeb extends StatelessWidget {
HeaderComponentWeb({Key? key}) : super(key: key);
final List<HeaderData> headerButtons = [
HeaderData("Heute", const Placeholder()),
HeaderData("Fortschritt", const Placeholder()),
HeaderData("Mahlzeitplan", const Placeholder())
];
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(headerButtons.length, (index) =>
HeaderButton(headerButtons[index].buttonText, headerButtons[index].page))
);
}
}
class HeaderData{
final String buttonText;
final Widget page;
HeaderData(this.buttonText, this.page);
@override
String toString() {
return 'HeaderData{route: $page, buttonText: $buttonText}';
}
}