minor fixes

This commit is contained in:
Thibault Deckers 2019-09-11 14:33:20 +09:00
parent 9cfa76c253
commit 1a997be925
3 changed files with 7 additions and 5 deletions

View file

@ -217,6 +217,8 @@ class ImageEntry {
return true;
}
bool get canPrint => !isVideo;
bool get canRotate => mimeType == MimeTypes.MIME_JPEG || mimeType == MimeTypes.MIME_PNG;
Future<bool> rotate({@required bool clockwise}) async {

View file

@ -12,7 +12,6 @@ class AChangeNotifier implements Listenable {
void dispose() => _listeners = null;
@protected
void notifyListeners() {
if (_listeners == null) return;
final localListeners = List<VoidCallback>.from(_listeners);

View file

@ -76,10 +76,11 @@ class FullscreenTopOverlay extends StatelessWidget {
value: FullscreenAction.rotateCW,
child: MenuRow(text: 'Rotate right', icon: Icons.rotate_right),
),
PopupMenuItem(
value: FullscreenAction.print,
child: MenuRow(text: 'Print', icon: Icons.print),
),
if (entry.canPrint)
PopupMenuItem(
value: FullscreenAction.print,
child: MenuRow(text: 'Print', icon: Icons.print),
),
PopupMenuDivider(),
PopupMenuItem(
value: FullscreenAction.edit,