WIP token send view

This commit is contained in:
julian 2023-03-30 10:55:02 -06:00
parent 8452758d17
commit 3064d31a3b
3 changed files with 1279 additions and 1 deletions

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,7 @@ import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart';
import 'package:stackwallet/pages/buy_view/buy_in_wallet_view.dart';
import 'package:stackwallet/pages/exchange_view/wallet_initiated_exchange_view.dart';
import 'package:stackwallet/pages/receive_view/receive_view.dart';
import 'package:stackwallet/pages/send_view/token_send_view.dart';
import 'package:stackwallet/pages/token_view/token_view.dart';
import 'package:stackwallet/pages/wallet_view/sub_widgets/wallet_refresh_button.dart';
import 'package:stackwallet/providers/global/wallets_provider.dart';
@ -176,7 +177,16 @@ class TokenWalletOptions extends StatelessWidget {
width: 16,
),
TokenOptionsButton(
onPressed: () {},
onPressed: () {
Navigator.of(context).pushNamed(
TokenSendView.routeName,
arguments: Tuple3(
walletId,
Coin.ethereum,
tokenContract,
),
);
},
subLabel: "Send",
iconAssetSVG: Assets.svg.send(context),
),

View file

@ -60,6 +60,7 @@ import 'package:stackwallet/pages/receive_view/generate_receiving_uri_qr_code_vi
import 'package:stackwallet/pages/receive_view/receive_view.dart';
import 'package:stackwallet/pages/send_view/confirm_transaction_view.dart';
import 'package:stackwallet/pages/send_view/send_view.dart';
import 'package:stackwallet/pages/send_view/token_send_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/about_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/debug_view.dart';
@ -1053,6 +1054,22 @@ class RouteGenerator {
}
return _routeError("${settings.name} invalid args: ${args.toString()}");
case TokenSendView.routeName:
if (args is Tuple3<String, Coin, EthContract>) {
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,
builder: (_) => TokenSendView(
walletId: args.item1,
coin: args.item2,
tokenContract: args.item3,
),
settings: RouteSettings(
name: settings.name,
),
);
}
return _routeError("${settings.name} invalid args: ${args.toString()}");
case ConfirmTransactionView.routeName:
if (args is Tuple2<Map<String, dynamic>, String>) {
return getRoute(