2022-08-06 18:15:16 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-08-06 20:13:12 +00:00
|
|
|
import 'package:localization/localization.dart';
|
2022-08-28 09:19:25 +00:00
|
|
|
import 'package:loris/business_logic/interactions/interactions.dart';
|
2022-08-06 20:13:12 +00:00
|
|
|
import 'package:loris/business_logic/timeline/timeline.dart';
|
2022-08-28 09:19:25 +00:00
|
|
|
import 'package:loris/partials/interaction_button.dart';
|
2022-08-06 20:13:12 +00:00
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
2022-08-06 18:15:16 +00:00
|
|
|
|
2022-08-06 20:13:12 +00:00
|
|
|
void popupPostOptions(context, PostModel model) {
|
2022-08-28 09:19:25 +00:00
|
|
|
showModalBottomSheet(
|
2022-08-06 20:13:12 +00:00
|
|
|
context: context,
|
|
|
|
builder: (context) {
|
2022-08-28 09:19:25 +00:00
|
|
|
List<Widget?> c = [
|
|
|
|
SelectableText("post-options".i18n(),
|
|
|
|
style: Theme.of(context).textTheme.displayMedium),
|
|
|
|
SelectableText(model.createdAt),
|
|
|
|
TextButton.icon(
|
|
|
|
onPressed: () {
|
|
|
|
launchUrl(
|
|
|
|
Uri.parse(model.uri),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
icon: const Icon(Icons.open_in_browser),
|
|
|
|
label: Text("show-in-browser".i18n()),
|
|
|
|
),
|
|
|
|
model.visibility.boostable
|
|
|
|
? InteractionButton(
|
|
|
|
model: model,
|
|
|
|
type: InteractionType.reblog,
|
|
|
|
extended: true,
|
|
|
|
)
|
|
|
|
: null,
|
|
|
|
InteractionButton(
|
|
|
|
model: model,
|
|
|
|
type: InteractionType.favorite,
|
|
|
|
extended: true,
|
|
|
|
),
|
|
|
|
];
|
|
|
|
return Scrollable(
|
|
|
|
viewportBuilder: ((context, position) =>
|
|
|
|
Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
|
|
|
for (var i in c)
|
|
|
|
if (i != null) i
|
|
|
|
])));
|
2022-08-06 20:13:12 +00:00
|
|
|
},
|
|
|
|
);
|
2022-08-06 18:15:16 +00:00
|
|
|
}
|