2021-08-23 07:59:30 +03:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:info_tren/pages/main/main_page.dart';
|
|
|
|
|
|
|
|
class MainPageMaterial extends MainPageShared {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text(pageTitle),
|
|
|
|
centerTitle: true,
|
2022-08-04 03:45:32 +03:00
|
|
|
actions: [
|
|
|
|
PopupMenuButton<int>(
|
|
|
|
icon: Icon(Icons.more_vert),
|
|
|
|
tooltip: moreOptionsText,
|
|
|
|
itemBuilder: (_) => popupMenu.asMap().entries.map((e) => PopupMenuItem(
|
|
|
|
child: Text(e.value.name),
|
|
|
|
value: e.key,
|
|
|
|
)).toList(),
|
|
|
|
onSelected: (index) {
|
|
|
|
popupMenu[index].action?.call(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
2021-08-23 07:59:30 +03:00
|
|
|
),
|
|
|
|
body: SafeArea(
|
|
|
|
child: Center(
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: options.map((option) => ElevatedButton(
|
|
|
|
child: Text(
|
|
|
|
option.name,
|
|
|
|
style: Theme.of(context).textTheme.button?.copyWith(fontSize: 18),
|
|
|
|
),
|
|
|
|
onPressed: option.action != null ? () => option.action!(context) : null,
|
|
|
|
)).map((w) => Padding(
|
|
|
|
padding: const EdgeInsets.fromLTRB(4, 2, 4, 2),
|
|
|
|
child: SizedBox(
|
|
|
|
width: double.infinity,
|
|
|
|
child: w,
|
|
|
|
),
|
|
|
|
)).toList(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|