56 lines
1.8 KiB
Dart
56 lines
1.8 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:info_tren/pages/main/main_page.dart';
|
|
|
|
class MainPageCupertino extends MainPageShared {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CupertinoPageScaffold(
|
|
navigationBar: CupertinoNavigationBar(
|
|
middle: Text(pageTitle),
|
|
trailing: CupertinoButton(
|
|
child: Icon(CupertinoIcons.ellipsis_circle),
|
|
padding: EdgeInsets.zero,
|
|
onPressed: () {
|
|
showCupertinoModalPopup(
|
|
context: context,
|
|
builder: (context) {
|
|
return CupertinoActionSheet(
|
|
actions: popupMenu.map((m) => CupertinoActionSheetAction(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
m.action?.call(context);
|
|
},
|
|
child: Text(m.name),
|
|
)).toList(),
|
|
cancelButton: CupertinoActionSheetAction(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
child: Text('Anulare'),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
},
|
|
),
|
|
),
|
|
child: SafeArea(
|
|
child: Center(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: options.map((option) => CupertinoButton.filled(
|
|
child: Text(option.name),
|
|
onPressed: option.action == null ? null : () => option.action!(context),
|
|
)).map((w) => Padding(
|
|
padding: const EdgeInsets.fromLTRB(4, 2, 4, 2),
|
|
child: SizedBox(
|
|
width: double.infinity,
|
|
child: w,
|
|
),
|
|
)).toList(),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|