56 lines
1.4 KiB
Dart
56 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class PongMenu extends StatelessWidget {
|
|
const PongMenu({
|
|
super.key,
|
|
required this.title,
|
|
required this.subTitle,
|
|
required this.child,
|
|
});
|
|
|
|
final String title;
|
|
final String subTitle;
|
|
final Widget child;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final mq = MediaQuery.of(context).size;
|
|
final dialogHeight = mq.height * 0.4;
|
|
final dialogWidth = mq.width * 0.8;
|
|
return Dialog(
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
elevation: 0,
|
|
backgroundColor: Colors.transparent,
|
|
child: Container(
|
|
width: dialogWidth,
|
|
height: dialogHeight,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(25),
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: [
|
|
Text(
|
|
title,
|
|
style: const TextStyle(
|
|
fontSize: 30,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
Text(
|
|
subTitle,
|
|
style: const TextStyle(
|
|
fontSize: 30,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
child,
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|