-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
228 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
...ages/espressocash_app/lib/features/token_swap/screens/token_swap_confirmation_screen.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: () {}, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} |
Oops, something went wrong.