2023-01-27 18:53:03 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2023-03-28 23:17:59 +00:00
|
|
|
import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart';
|
2023-01-27 18:53:03 +00:00
|
|
|
import 'package:stackwallet/pages/buy_view/buy_view.dart';
|
2023-01-27 19:47:41 +00:00
|
|
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
2023-01-27 18:53:03 +00:00
|
|
|
import 'package:stackwallet/utilities/text_styles.dart';
|
|
|
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
|
|
|
import 'package:stackwallet/widgets/background.dart';
|
|
|
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
|
|
|
|
|
|
|
class BuyInWalletView extends StatefulWidget {
|
2023-01-27 19:47:41 +00:00
|
|
|
const BuyInWalletView({
|
|
|
|
Key? key,
|
|
|
|
required this.coin,
|
2023-03-28 23:17:59 +00:00
|
|
|
this.contract,
|
2023-01-27 19:47:41 +00:00
|
|
|
}) : super(key: key);
|
2023-01-27 18:53:03 +00:00
|
|
|
|
|
|
|
static const String routeName = "/stackBuyInWalletView";
|
|
|
|
|
2023-01-27 19:47:41 +00:00
|
|
|
final Coin? coin;
|
2023-03-28 23:17:59 +00:00
|
|
|
final EthContract? contract;
|
2023-01-27 19:47:41 +00:00
|
|
|
|
2023-01-27 18:53:03 +00:00
|
|
|
@override
|
|
|
|
State<BuyInWalletView> createState() => _BuyInWalletViewState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _BuyInWalletViewState extends State<BuyInWalletView> {
|
2023-01-27 19:47:41 +00:00
|
|
|
late final Coin? coin;
|
|
|
|
|
2023-01-27 18:53:03 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
debugPrint("BUILD: $runtimeType");
|
|
|
|
|
|
|
|
return Background(
|
|
|
|
child: Scaffold(
|
|
|
|
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
|
|
|
|
appBar: AppBar(
|
|
|
|
leading: AppBarBackButton(
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
title: Text(
|
2023-01-27 20:00:51 +00:00
|
|
|
"Buy ${widget.coin?.ticker}",
|
2023-01-27 18:53:03 +00:00
|
|
|
style: STextStyles.navBarTitle(context),
|
|
|
|
),
|
|
|
|
),
|
2023-03-28 23:17:59 +00:00
|
|
|
body: BuyView(
|
|
|
|
coin: widget.coin,
|
2023-03-29 14:29:40 +00:00
|
|
|
tokenContract: widget.contract,
|
2023-03-28 23:17:59 +00:00
|
|
|
),
|
2023-01-27 18:53:03 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|