Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
imprv: Removed isBalanceZero for fund check
Browse files Browse the repository at this point in the history
  • Loading branch information
reasje committed Oct 31, 2023
1 parent fb76886 commit ca8a269
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SendCryptoPage extends HookConsumerWidget {
Key? key,
required this.token,
this.qrCode,
required this.isBalanceZero
required this.isBalanceZero,
}) : super(key: key);

final Token token;
Expand All @@ -28,15 +28,13 @@ class SendCryptoPage extends HookConsumerWidget {
sendTokenPageContainer.actions(SendCryptoArguments(
token: token,
qrCode: qrCode,
isBalanceZero: isBalanceZero
));

@override
ProviderBase<SendCryptoState> get state =>
sendTokenPageContainer.state(SendCryptoArguments(
token: token,
qrCode: qrCode,
isBalanceZero: isBalanceZero
));

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,36 @@ import 'send_crypto_state.dart';
import 'widgets/transaction_dialog.dart';

class SendCryptoArguments with EquatableMixin {
const SendCryptoArguments(
{required this.token, this.qrCode, required this.isBalanceZero});
const SendCryptoArguments({
required this.token,
this.qrCode,
});

final Token token;
final String? qrCode;
final bool isBalanceZero;

@override
List<dynamic> get props => [token, qrCode];
List<dynamic> get props => [
token,
qrCode,
];
}

final sendTokenPageContainer = PresenterContainerWithParameter<
SendCryptoPresenter, SendCryptoState, SendCryptoArguments>(
(params) =>
SendCryptoPresenter(params.token, params.qrCode, params.isBalanceZero));
(params) => SendCryptoPresenter(
params.token,
params.qrCode,
));

class SendCryptoPresenter extends CompletePresenter<SendCryptoState> {
SendCryptoPresenter(this.token, String? qrCode, this.isBalanceZero)
: super(SendCryptoState()..qrCode = qrCode);
SendCryptoPresenter(
this.token,
String? qrCode,
) : super(SendCryptoState()..qrCode = qrCode);

final Token token;

// Native token balance
final bool isBalanceZero;

late final _transactionHistoryUseCase =
ref.read(transactionHistoryUseCaseProvider);
late final TokenContractUseCase _tokenContractUseCase =
Expand Down

0 comments on commit ca8a269

Please sign in to comment.