|
|
|
|
@ -16,7 +16,8 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
|
|
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
|
import 'package:share/share.dart';
|
|
|
|
|
import 'package:share_plus/share_plus.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
class OffersAndDiscountsDetails extends StatefulWidget {
|
|
|
|
|
@ -127,7 +128,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
|
|
|
|
|
Directory tempDir = await getTemporaryDirectory();
|
|
|
|
|
File file = await File('${tempDir.path}/${DateTime.now().toString()}.png').create();
|
|
|
|
|
await file.writeAsBytes(pngBytes);
|
|
|
|
|
await Share.shareFiles([(file.path)], text: AppState().isArabic(context) ? getOffersList[0].titleAr : getOffersList[0].titleEn);
|
|
|
|
|
await Share.shareXFiles([XFile(file.path)], text: AppState().isArabic(context) ? getOffersList[0].titleAr : getOffersList[0].titleEn);
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
debugPrint(ex.toString());
|
|
|
|
|
}
|
|
|
|
|
|