| 1 | import 'package:cake_wallet/generated/i18n.dart'; |
| 2 | import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart'; |
| 3 | import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart'; |
| 4 | import 'package:flutter/material.dart'; |
| 5 | |
| 6 | class HardwareWalletTrezorParingSheet extends StatefulWidget { |
| 7 | const HardwareWalletTrezorParingSheet({super.key}); |
| 8 | |
| 9 | @override |
| 10 | State<HardwareWalletTrezorParingSheet> createState() => _HardwareWalletTrezorParingSheetState(); |
| 11 | } |
| 12 | |
| 13 | class _HardwareWalletTrezorParingSheetState extends State<HardwareWalletTrezorParingSheet> { |
| 14 | final TextEditingController _paringCodeController = TextEditingController(); |
| 15 | |
| 16 | @override |
| 17 | Widget build(BuildContext context) { |
| 18 | return Padding( |
| 19 | padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), |
| 20 | child: SafeArea( |
| 21 | child: Container( |
| 22 | decoration: BoxDecoration( |
| 23 | borderRadius: BorderRadius.vertical(top: Radius.circular(18)), |
| 24 | color: Theme.of(context).colorScheme.surface, |
| 25 | ), |
| 26 | child: Column( |
| 27 | mainAxisSize: MainAxisSize.min, |
| 28 | crossAxisAlignment: CrossAxisAlignment.start, |
| 29 | children: [ |
| 30 | ModalTopBar( |
| 31 | title: "Paring code", |
| 32 | onLeadingPressed: Navigator.of(context).pop, |
| 33 | onTrailingPressed: () {}, |
| 34 | leadingIcon: Icon(Icons.close), |
| 35 | leadingSemanticLabel: S.of(context).close, |
| 36 | ), |
| 37 | Padding( |
| 38 | padding: const EdgeInsets.all(18.0), |
| 39 | child: Column( |
| 40 | mainAxisSize: MainAxisSize.min, |
| 41 | crossAxisAlignment: CrossAxisAlignment.start, |
| 42 | spacing: 12, |
| 43 | children: [ |
| 44 | SizedBox(), |
| 45 | Row( |
| 46 | mainAxisAlignment: MainAxisAlignment.center, |
| 47 | children: [ |
| 48 | Expanded( |
| 49 | flex: 75, |
| 50 | child: AnimatedContainer( |
| 51 | duration: Duration(milliseconds: 300), |
| 52 | height: 60, |
| 53 | decoration: BoxDecoration( |
| 54 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 55 | borderRadius: BorderRadius.only( |
| 56 | topLeft: Radius.circular(16), |
| 57 | bottomLeft: Radius.circular(16), |
| 58 | ), |
| 59 | border: Border.all( |
| 60 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 61 | width: 2, |
| 62 | ), |
| 63 | ), |
| 64 | child: TextField( |
| 65 | textAlign: TextAlign.left, |
| 66 | textAlignVertical: TextAlignVertical.center, |
| 67 | controller: _paringCodeController, |
| 68 | keyboardType: |
| 69 | TextInputType.numberWithOptions(signed: false, decimal: false), |
| 70 | decoration: InputDecoration( |
| 71 | hint: Text( |
| 72 | "000 000", |
| 73 | textAlign: TextAlign.center, |
| 74 | style: TextStyle( |
| 75 | fontSize: 16, |
| 76 | color: Theme.of( |
| 77 | context, |
| 78 | ).colorScheme.onSurface.withValues(alpha: 0.5), |
| 79 | ), |
| 80 | ), |
| 81 | border: InputBorder.none, |
| 82 | filled: true, |
| 83 | fillColor: Colors.transparent, |
| 84 | ), |
| 85 | style: TextStyle(color: Theme.of(context).colorScheme.onSurface), |
| 86 | ), |
| 87 | ), |
| 88 | ), |
| 89 | ], |
| 90 | ), |
| 91 | SizedBox(), |
| 92 | NewPrimaryButton( |
| 93 | text: S.of(context).continue_text, |
| 94 | onPressed: () => Navigator.of(context).pop(_paringCodeController.text), |
| 95 | color: Theme.of(context).colorScheme.primary, |
| 96 | textColor: Theme.of(context).colorScheme.onPrimary, |
| 97 | ) |
| 98 | ], |
| 99 | ), |
| 100 | ) |
| 101 | ], |
| 102 | ), |
| 103 | ), |
| 104 | ), |
| 105 | ); |
| 106 | } |
| 107 | } |