44 lines
1.4 KiB
Dart
44 lines
1.4 KiB
Dart
import 'package:aman_kassa_flutter/core/models/choice.dart';
|
||
import 'package:aman_kassa_flutter/shared/app_colors.dart';
|
||
import 'package:flutter/material.dart';
|
||
|
||
const List<Choice> choices = const <Choice>[
|
||
//const Choice(title: 'Обновить номенклатуру', icon: Icons.update, command: 'update'),
|
||
//const Choice(title: 'Помощь', icon: Icons.help, command: 'help'),
|
||
const Choice(
|
||
title: 'Информация о ККМ', icon: Icons.info_outline, command: 'infokkm'),
|
||
//const Choice(title: 'Язык', icon: Icons.language, command: 'language'),
|
||
const Choice(title: 'Bank', icon: Icons.text_fields, command: 'bank'),
|
||
const Choice(title: 'Выйти', icon: Icons.exit_to_app, command: 'exit')
|
||
];
|
||
|
||
class PopupMenu extends StatelessWidget {
|
||
|
||
final void Function(Choice value) onSelectChoice;
|
||
|
||
PopupMenu({this.onSelectChoice});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return PopupMenuButton<Choice>(
|
||
icon: Icon(
|
||
Icons.more_vert,
|
||
color: menuColor,
|
||
),
|
||
onSelected: onSelectChoice,
|
||
itemBuilder: (BuildContext context) {
|
||
return choices.map((Choice choice) {
|
||
return PopupMenuItem<Choice>(
|
||
value: choice,
|
||
child: Row(children: <Widget>[
|
||
Icon(choice.icon, color: primaryColor,),
|
||
SizedBox(width: 5,),
|
||
Text(choice.title)
|
||
], ),
|
||
);
|
||
}).toList();
|
||
},
|
||
);
|
||
}
|
||
}
|