nc-photos/lib/widget/share_method_dialog.dart
2021-10-09 16:46:18 +08:00

53 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:nc_photos/app_localizations.dart';
import 'package:nc_photos/platform/k.dart' as platform_k;
enum ShareMethod {
file,
publicLink,
passwordLink,
}
class ShareMethodDialog extends StatelessWidget {
const ShareMethodDialog({
Key? key,
}) : super(key: key);
@override
build(BuildContext context) {
return SimpleDialog(
title: Text(L10n.global().shareMethodDialogTitle),
children: [
if (platform_k.isAndroid)
SimpleDialogOption(
child: ListTile(
title: Text(L10n.global().shareMethodFileTitle),
subtitle: Text(L10n.global().shareMethodFileDescription),
),
onPressed: () {
Navigator.of(context).pop(ShareMethod.file);
},
),
SimpleDialogOption(
child: ListTile(
title: Text(L10n.global().shareMethodPublicLinkTitle),
subtitle: Text(L10n.global().shareMethodPublicLinkDescription),
),
onPressed: () {
Navigator.of(context).pop(ShareMethod.publicLink);
},
),
SimpleDialogOption(
child: ListTile(
title: Text(L10n.global().shareMethodPasswordLinkTitle),
subtitle: Text(L10n.global().shareMethodPasswordLinkDescription),
),
onPressed: () {
Navigator.of(context).pop(ShareMethod.passwordLink);
},
),
],
);
}
}