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.

65 lines
2.1 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>(
2 years ago
icon: const Icon(Icons.more_vert),
tooltip: moreOptionsText,
itemBuilder: (_) => popupMenu.asMap().entries.map((e) => PopupMenuItem(
value: e.key,
2 years ago
child: Text(e.value.name),
)).toList(),
onSelected: (index) {
popupMenu[index].action?.call(context);
},
),
],
),
body: SafeArea(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: options.map((option) => Card(
color: option.action != null ? Theme.of(context).colorScheme.secondaryContainer : null,
child: InkWell(
onTap: option.action != null ? () => option.action!(context) : null,
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
option.name,
2 years ago
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
color: Theme.of(context).colorScheme.onSecondaryContainer,
),
textAlign: TextAlign.center,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(option.description!),
),
],
),
),
)).map((w) => Padding(
padding: const EdgeInsets.fromLTRB(4, 2, 4, 2),
child: SizedBox(
width: double.infinity,
child: w,
),
)).toList(),
),
),
),
);
}
}