Skip to content

Commit

Permalink
Appui long sur une carte dans l'historique pour partager
Browse files Browse the repository at this point in the history
  • Loading branch information
johan-perso committed Mar 11, 2024
1 parent 4917c0f commit b4c9daa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/pages/download.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:get_storage/get_storage.dart';
import 'package:html/parser.dart';
import 'package:tuple/tuple.dart';
import 'package:path/path.dart' as path;
import 'package:share_plus/share_plus.dart';
import 'package:dio/dio.dart';

final dio = Dio(BaseOptions(
Expand Down Expand Up @@ -835,6 +836,17 @@ class _DownloadPageState extends State<DownloadPage> {
child: ListTile(
title: Text(historic[index]["filename"], overflow: TextOverflow.ellipsis, maxLines: 3),
subtitle: Text("${formatDate(historic[index]["date"])} ― ${formatBytes(historic[index]["filesize"] ?? '0')}${historic[index]["filetype"] != null && historic[index]["filetype"].isNotEmpty ? " ― ${historic[index]["filetype"]}" : ""}"),
onLongPress: () {
HapticFeedback.lightImpact();

final screenSize = MediaQuery.of(context).size;
final rect = Rect.fromCenter(
center: Offset(screenSize.width / 2, screenSize.height / 2),
width: 100,
height: 100,
);
Share.share(historic[index]["access"], sharePositionOrigin: rect);
},
onTap: () {
HapticFeedback.lightImpact();
urlController.text = historic[index]["access"];
Expand Down

0 comments on commit b4c9daa

Please sign in to comment.