Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Merculiar committed Jan 29, 2025
1 parent fd7703a commit be34c17
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import '../../currency/models/currency.dart';
import '../../ramp/widgets/ramp_buttons.dart';
import '../../token_send/screens/token_send_input_screen.dart';
import '../../token_send/widgets/token_app_bar.dart';
import '../../token_swap/screens/token_swap_screen.dart';
import '../../token_swap/screens/token_swap_input_screen.dart';
import '../../tokens/token.dart';
import '../widgets/token_info.dart';

Expand Down Expand Up @@ -246,7 +246,7 @@ class _ActionButtons extends StatelessWidget {
text: 'Swap',
minWidth: 106,
size: CpButtonSize.big,
onPressed: () => TokenSwapScreen.push(
onPressed: () => TokenSwapInputScreen.push(
context,
token: token,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ class TokenSendConfirmationScreen extends StatefulWidget {
final Token token;

@override
State<TokenSendConfirmationScreen> createState() => _ScreenState();
State<TokenSendConfirmationScreen> createState() =>
_TokenSendConfirmationScreenState();
}

class _ScreenState extends State<TokenSendConfirmationScreen> {
class _TokenSendConfirmationScreenState
extends State<TokenSendConfirmationScreen> {
late final TextEditingController _amountController;
late Future<CryptoAmount> _feeAmount;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import 'package:decimal/decimal.dart';
import 'package:flutter/material.dart';

import '../../../ui/bottom_button.dart';
import '../../../ui/colors.dart';
import '../../tokens/token.dart';

class TokenSwapConfirmationScreen extends StatelessWidget {
const TokenSwapConfirmationScreen({
super.key,
required this.payAmount,
required this.payToken,
required this.receiveAmount,
required this.receiveToken,
});

static Future<Decimal?> push(
BuildContext context, {
required Token payToken,
required String payAmount,
required Token receiveToken,
required String receiveAmount,
}) =>
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => TokenSwapConfirmationScreen(
payAmount: payAmount,
payToken: payToken,
receiveAmount: receiveAmount,
receiveToken: receiveToken,
),
),
);

final String payAmount;
final Token payToken;
final String receiveAmount;
final Token receiveToken;

@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: CpColors.deepGreyColor,
body: Stack(
children: [
SafeArea(
minimum: const EdgeInsets.only(bottom: 40),
child: ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(31),
topRight: Radius.circular(31),
),
child: LayoutBuilder(
builder: (
BuildContext context,
BoxConstraints viewportConstraints,
) =>
DecoratedBox(
decoration: const BoxDecoration(),
child: IntrinsicHeight(
child: Column(
children: [
const SizedBox(height: 36),
Expanded(
child: DecoratedBox(
decoration: const BoxDecoration(
color: CpColors.deepGreyColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(31),
topRight: Radius.circular(31),
),
),
child: Container(),
),
),
CpBottomButton(
text: 'Confirm Swap',
onPressed: () {},
),
],
),
),
),
),
),
),
],
),
);
}
Loading

0 comments on commit be34c17

Please sign in to comment.