aves/lib/model/actions/slideshow.dart
Thibault Deckers b5aaad4df8 refactor
2023-03-28 12:56:39 +02:00

30 lines
915 B
Dart

import 'package:aves/theme/icons.dart';
import 'package:aves/widgets/common/extensions/build_context.dart';
import 'package:aves_model/aves_model.dart';
import 'package:flutter/widgets.dart';
extension ExtraSlideshowAction on SlideshowAction {
String getText(BuildContext context) {
switch (this) {
case SlideshowAction.resume:
return context.l10n.slideshowActionResume;
case SlideshowAction.showInCollection:
return context.l10n.slideshowActionShowInCollection;
case SlideshowAction.settings:
return context.l10n.viewerActionSettings;
}
}
Widget getIcon() => Icon(_getIconData());
IconData _getIconData() {
switch (this) {
case SlideshowAction.resume:
return AIcons.play;
case SlideshowAction.showInCollection:
return AIcons.allCollection;
case SlideshowAction.settings:
return AIcons.settings;
}
}
}