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