mirror of
https://github.com/johrpan/christmas_cats.git
synced 2025-10-28 19:27:25 +01:00
Version 0.1.0
This commit is contained in:
commit
5dda59a6cd
73 changed files with 5741 additions and 0 deletions
57
lib/widgets/menu.dart
Normal file
57
lib/widgets/menu.dart
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
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),
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue