Skip to content

Commit

Permalink
Add desktop fallback to use SharePlus
Browse files Browse the repository at this point in the history
Not sure if this is the best approach - maybe copy to clipboard? Either way probably doesn't matter too much. It's just a bit nicer than throwing errors just in case.
  • Loading branch information
Restioson authored and bonomat committed Jul 27, 2023
1 parent ad66367 commit ebe4b47
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mobile/lib/features/trade/trade_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import 'package:get_10101/features/trade/trade_value_change_notifier.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:get_10101/util/constants.dart';
import 'package:share_plus/share_plus.dart';
import 'package:social_share/social_share.dart';
import 'dart:io' show Platform;

import 'order_submission_status_dialog.dart';

Expand Down Expand Up @@ -394,7 +396,13 @@ class TradeScreen extends StatelessWidget {

Future<void> shareTweet(PositionAction action) async {
String actionStr = action == PositionAction.open ? "opened" : "closed";
await SocialShare.shareTwitter(
"Just $actionStr a #selfcustodial position using #DLC with @get10101 🚀. The future of decentralised finance starts now! #Bitcoin");
String shareText =
"Just $actionStr a #selfcustodial position using #DLC with @get10101 🚀. The future of decentralised finance starts now! #Bitcoin";

if (Platform.isAndroid || Platform.isIOS) {
await SocialShare.shareTwitter(shareText);
} else {
await Share.share(shareText);
}
}
}

0 comments on commit ebe4b47

Please sign in to comment.