mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-08 20:09:24 +00:00
check share plugin usage (#567)
* replace share plugin with share_plus * fix share button on receive screen * add share button for btc, ltc wallets
This commit is contained in:
parent
95ecf4ef56
commit
4f2cf983de
4 changed files with 37 additions and 29 deletions
|
@ -15,6 +15,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
|||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:keyboard_actions/keyboard_actions.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
class AddressPage extends BasePage {
|
||||
AddressPage({
|
||||
|
@ -85,6 +86,26 @@ class AddressPage extends BasePage {
|
|||
], begin: Alignment.topRight, end: Alignment.bottomLeft)),
|
||||
child: scaffold);
|
||||
|
||||
@override
|
||||
Widget? trailing(BuildContext context) {
|
||||
final shareImage =
|
||||
Image.asset('assets/images/share.png',
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!);
|
||||
|
||||
return !addressListViewModel.hasAddressList ? Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: BoxConstraints(),
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
iconSize: 25,
|
||||
onPressed: () => Share.share(addressListViewModel.address.address),
|
||||
icon: shareImage,
|
||||
),
|
||||
) : null;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) {
|
||||
autorun((_) async {
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:cw_core/wallet_type.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
// import 'package:esys_flutter_share/esys_flutter_share.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/di.dart';
|
||||
|
@ -92,23 +92,17 @@ class ReceivePage extends BasePage {
|
|||
Image.asset('assets/images/share.png',
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!);
|
||||
|
||||
return SizedBox(
|
||||
height: 20.0,
|
||||
width: 20.0,
|
||||
child: ButtonTheme(
|
||||
minWidth: double.minPositive,
|
||||
child: TextButton(
|
||||
// FIX-ME: Style
|
||||
//highlightColor: Colors.transparent,
|
||||
//splashColor: Colors.transparent,
|
||||
//padding: EdgeInsets.all(0),
|
||||
onPressed: () {
|
||||
// FIX-ME: Share esys_flutter_share.dart
|
||||
// Share.text(S.current.share_address,
|
||||
// addressListViewModel.address.address, 'text/plain')
|
||||
},
|
||||
child: shareImage),
|
||||
),
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: BoxConstraints(),
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
iconSize: 25,
|
||||
onPressed: () => Share.share(addressListViewModel.address.address),
|
||||
icon: shareImage
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:cake_wallet/utils/show_pop_up.dart';
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
// import 'package:esys_flutter_share/esys_flutter_share.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
|
@ -159,13 +159,8 @@ class WalletSeedPage extends BasePage {
|
|||
child: Container(
|
||||
padding: EdgeInsets.only(right: 8.0),
|
||||
child: PrimaryButton(
|
||||
onPressed: () {
|
||||
// FIX-ME: Share esys_flutter_share
|
||||
// Share.text(
|
||||
// S.of(context).seed_share,
|
||||
// walletSeedViewModel.seed,
|
||||
// 'text/plain')
|
||||
},
|
||||
onPressed: () =>
|
||||
Share.share(walletSeedViewModel.seed),
|
||||
text: S.of(context).save,
|
||||
color: Colors.green,
|
||||
textColor: Colors.white),
|
||||
|
|
|
@ -25,9 +25,7 @@ dependencies:
|
|||
mobx: ^2.0.7+4
|
||||
flutter_mobx: ^2.0.6+1
|
||||
flutter_slidable: ^2.0.0
|
||||
share: ^2.0.1
|
||||
# share_plus: ^4.0.10
|
||||
# esys_flutter_share: ^1.0.2
|
||||
share_plus: ^4.0.10
|
||||
# date_range_picker: ^1.0.6
|
||||
#https://api.flutter.dev/flutter/material/showDateRangePicker.html
|
||||
dio: ^4.0.6
|
||||
|
|
Loading…
Reference in a new issue