Skip to content

Commit

Permalink
Replace Share with Share_plus
Browse files Browse the repository at this point in the history
  • Loading branch information
ppupha committed Oct 17, 2023
1 parent 43a0faf commit a305080
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 30 deletions.
2 changes: 1 addition & 1 deletion lib/screen/detail/artwork_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import 'package:json_annotation/json_annotation.dart';
import 'package:nft_collection/models/asset_token.dart';
import 'package:nft_collection/models/provenance.dart';
import 'package:nft_collection/nft_collection.dart';
import 'package:share/share.dart';
import 'package:share_plus/share_plus.dart';
import 'package:social_share/social_share.dart';
import 'package:url_launcher/url_launcher.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/screen/global_receive/receive_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:share/share.dart';
import 'package:share_plus/share_plus.dart';

class GlobalReceiveDetailPage extends StatefulWidget {
static const tag = "global_receive_detail";
Expand Down
2 changes: 1 addition & 1 deletion lib/screen/interactive_postcard/postcard_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import 'package:nft_collection/models/asset_token.dart';
import 'package:nft_collection/models/provenance.dart';
import 'package:nft_collection/widgets/nft_collection_bloc.dart';
import 'package:nft_collection/widgets/nft_collection_bloc_event.dart';
import 'package:share/share.dart';
import 'package:share_plus/share_plus.dart';

class PostcardDetailPagePayload extends ArtworkDetailPayload {
final bool isFromLeaderboard;
Expand Down
21 changes: 0 additions & 21 deletions lib/service/postcard_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import 'package:nft_collection/services/tokens_service.dart';
import 'package:nft_collection/widgets/nft_collection_bloc.dart';
import 'package:nft_collection/widgets/nft_collection_bloc_event.dart';
import 'package:path_provider/path_provider.dart';
import 'package:share/share.dart';

import 'account_service.dart';

Expand Down Expand Up @@ -103,12 +102,6 @@ abstract class PostcardService {

Future<void> downloadPostcard(String tokenId);

Future<void> shareStampToTwitter({
required String tokenId,
required int stampIndex,
String caption = "",
});

String getTokenId(String id);

Future<AssetToken> claimEmptyPostcardToAddress(
Expand Down Expand Up @@ -494,20 +487,6 @@ class PostcardServiceImpl extends PostcardService {
await imageFile.delete();
}

@override
Future<void> shareStampToTwitter({
required String tokenId,
required int stampIndex,
String caption = "",
}) async {
final imageFile =
await _downloadStamp(tokenId: tokenId, stampIndex: stampIndex);
Share.shareFiles(
[imageFile.path],
text: caption,
);
}

@override
String getTokenId(String id) {
return "tez-${Environment.postcardContractAddress}-$id";
Expand Down
2 changes: 1 addition & 1 deletion lib/util/ui_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:jiffy/jiffy.dart';
import 'package:share/share.dart';
import 'package:share_plus/share_plus.dart';

enum ActionState { notRequested, loading, error, done }

Expand Down
16 changes: 12 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2220,14 +2220,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.0"
share:
share_plus:
dependency: "direct main"
description:
name: share
sha256: "97e6403f564ed1051a01534c2fc919cb6e40ea55e60a18ec23cee6e0ce19f4be"
name: share_plus
sha256: f74fc3f1cbd99f39760182e176802f693fa0ec9625c045561cfad54681ea93dd
url: "https://pub.dev"
source: hosted
version: "2.0.4"
version: "7.2.1"
share_plus_platform_interface:
dependency: transitive
description:
name: share_plus_platform_interface
sha256: df08bc3a07d01f5ea47b45d03ffcba1fa9cd5370fb44b3f38c70e42cced0f956
url: "https://pub.dev"
source: hosted
version: "3.3.1"
shared_preferences:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ dependencies:
sentry_dio: ^7.9.0
sentry_flutter: ^7.9.0
shake: ^2.0.0
share: ^2.0.4
share_plus: ^7.2.1
shared_preferences: ^2.0.0
synchronized: ^3.0.0+2
social_share: ^2.3.1
Expand Down

0 comments on commit a305080

Please sign in to comment.