2022-04-05 12:46:22 +03:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'app_page.dart';
|
|
|
|
|
|
|
|
class MessagePage extends StatelessWidget {
|
|
|
|
final Widget? title;
|
2022-05-20 12:11:20 +03:00
|
|
|
final Widget? graphic;
|
|
|
|
final String? header;
|
2022-05-18 15:11:17 +03:00
|
|
|
final String? message;
|
2022-05-20 14:00:07 +03:00
|
|
|
final List<Widget> actions;
|
2022-07-07 21:20:04 +03:00
|
|
|
final List<PopupMenuEntry> keyActions;
|
2022-04-05 12:46:22 +03:00
|
|
|
|
|
|
|
const MessagePage({
|
2022-05-12 10:56:55 +03:00
|
|
|
super.key,
|
2022-04-05 12:46:22 +03:00
|
|
|
this.title,
|
2022-05-20 12:11:20 +03:00
|
|
|
this.graphic,
|
|
|
|
this.header,
|
2022-05-18 15:11:17 +03:00
|
|
|
this.message,
|
2022-05-20 12:11:20 +03:00
|
|
|
this.actions = const [],
|
2022-07-07 21:20:04 +03:00
|
|
|
this.keyActions = const [],
|
2022-05-12 10:56:55 +03:00
|
|
|
});
|
2022-04-05 12:46:22 +03:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) => AppPage(
|
|
|
|
title: title,
|
|
|
|
centered: true,
|
2022-05-20 12:11:20 +03:00
|
|
|
actions: actions,
|
2022-07-07 21:20:04 +03:00
|
|
|
keyActions: keyActions,
|
2022-05-20 12:11:20 +03:00
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
if (graphic != null) graphic!,
|
|
|
|
if (header != null)
|
|
|
|
Text(header!,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: Theme.of(context).textTheme.titleMedium),
|
|
|
|
const SizedBox(height: 12.0),
|
|
|
|
if (message != null) ...[
|
|
|
|
Text(message!, textAlign: TextAlign.center),
|
|
|
|
],
|
2022-05-18 15:11:17 +03:00
|
|
|
],
|
2022-05-20 12:11:20 +03:00
|
|
|
),
|
2022-04-05 12:46:22 +03:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|