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.
 
 
 
 
 
 

56 lines
1.8 KiB

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