You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.4 KiB

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,
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);
},
),
],
),
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(),
),
),
),
);
}
}