mirror of
https://gitlab.com/openlp/openlp-mobile-remote.git
synced 2024-12-23 04:12:49 +00:00
42 lines
938 B
Dart
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(),
|
|
);
|
|
}
|
|
}
|