mirror of
https://github.com/johrpan/christmas_cats.git
synced 2025-10-28 19:27:25 +01:00
58 lines
1.2 KiB
Dart
58 lines
1.2 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
import '../localizations.dart';
|
||
|
|
|
||
|
|
import 'menu_entry.dart';
|
||
|
|
|
||
|
|
class Menu extends StatelessWidget {
|
||
|
|
final String title;
|
||
|
|
final String subtitle;
|
||
|
|
final List<Widget> children;
|
||
|
|
final bool showBackButton;
|
||
|
|
|
||
|
|
Menu({
|
||
|
|
this.title,
|
||
|
|
this.subtitle,
|
||
|
|
this.children,
|
||
|
|
this.showBackButton = false,
|
||
|
|
});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
final localizations = ChristmasCatsLocalizations.of(context);
|
||
|
|
|
||
|
|
return Column(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
|
children: <Widget>[
|
||
|
|
if (title != null)
|
||
|
|
Text(
|
||
|
|
title,
|
||
|
|
style: TextStyle(
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
fontSize: 64.0,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
if (subtitle != null)
|
||
|
|
Text(
|
||
|
|
subtitle,
|
||
|
|
style: TextStyle(fontSize: 32.0),
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 16.0,
|
||
|
|
),
|
||
|
|
...?children,
|
||
|
|
if (showBackButton) ...[
|
||
|
|
SizedBox(
|
||
|
|
height: 32.0,
|
||
|
|
),
|
||
|
|
MenuEntry(
|
||
|
|
text: localizations.back,
|
||
|
|
onTap: () => Navigator.pop(context),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
],
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|