openlp-mobile-remote/lib/widgets/display_options_bottom_sheet.dart
2019-07-24 18:00:24 -03:00

42 lines
938 B
Dart

import 'package:flutter/material.dart';
class _Action {
String title;
VoidCallback callback;
_Action(this.title, this.callback);
}
class DisplayOptionsDialog extends StatelessWidget {
final List<_Action> _actions = [
_Action('Blank', () {
print('Blank screen');
}),
_Action('Theme', () {
print('Theme screen');
}),
_Action('Desktop', () {
print('Desktop screen');
}),
_Action('Show', () {
print('Show screen');
}),
];
@override
Widget build(BuildContext context) {
return SimpleDialog(
contentPadding: EdgeInsets.all(20.0),
children: _actions
.map((action) => OutlineButton(
color: Colors.red,
child: Text(action.title),
onPressed: () {
action.callback();
Navigator.of(context).pop();
},
))
.toList(),
);
}
}