@@ -2,12 +2,10 @@ import 'dart:async';
22import 'dart:io' ;
33
44import 'package:decimal/decimal.dart' ;
5- import 'package:flutter/gestures.dart' ;
65import 'package:flutter/material.dart' ;
76import 'package:flutter/services.dart' ;
87import 'package:flutter_riverpod/flutter_riverpod.dart' ;
98import 'package:flutter_svg/svg.dart' ;
10- import 'package:url_launcher/url_launcher.dart' ;
119
1210import '../../app_config.dart' ;
1311import '../../models/isar/models/ethereum/eth_contract.dart' ;
@@ -48,7 +46,6 @@ class ShopInBitPaymentView extends ConsumerStatefulWidget {
4846}
4947
5048class _ShopInBitPaymentViewState extends ConsumerState <ShopInBitPaymentView > {
51- bool _termsAccepted = false ;
5249 bool _loading = false ;
5350 int _selectedMethod = 0 ;
5451 Timer ? _pollTimer;
@@ -76,8 +73,7 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
7673 'payment_processing' ,
7774 }.contains (_status);
7875
79- bool get _payNowEnabled =>
80- _termsAccepted && ! _isExpiredOrInvalid && ! _isTerminal;
76+ bool get _payNowEnabled => ! _isExpiredOrInvalid && ! _isTerminal;
8177
8278 @override
8379 void initState () {
@@ -160,11 +156,6 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
160156 }
161157 }
162158
163- Future <void > _openTerms () async {
164- const url = "https://api.shopinbit.com/static/policy/terms.html" ;
165- await launchUrl (Uri .parse (url), mode: LaunchMode .externalApplication);
166- }
167-
168159 Future <void > _checkForPayment () async {
169160 _pollTimer? .cancel ();
170161 setState (() => _loading = true );
@@ -334,6 +325,14 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
334325 Navigator .of (context).pop ();
335326 }
336327
328+ void _navigateToTickets () {
329+ if (Util .isDesktop) {
330+ Navigator .of (context, rootNavigator: true ).pop ();
331+ } else {
332+ Navigator .of (context).popUntil ((route) => route.isFirst);
333+ }
334+ }
335+
337336 void _navigateToSendFrom ({
338337 required CryptoCurrency coin,
339338 required Amount ? amount,
@@ -709,59 +708,15 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
709708 ],
710709 ),
711710 ),
711+ SizedBox (height: isDesktop ? 16 : 12 ),
712+ PrimaryButton (
713+ label: "View My Requests" ,
714+ onPressed: _navigateToTickets,
715+ ),
712716 ],
713717 SizedBox (height: isDesktop ? 24 : 16 ),
714718 // Coin list (replaces tab selector + QR + address + global button)
715719 if (! _isExpiredOrInvalid) ...coinRows,
716- SizedBox (height: isDesktop ? 16 : 12 ),
717- GestureDetector (
718- onTap: () {
719- setState (() {
720- _termsAccepted = ! _termsAccepted;
721- });
722- },
723- child: Container (
724- color: Colors .transparent,
725- child: Row (
726- crossAxisAlignment: CrossAxisAlignment .start,
727- children: [
728- SizedBox (
729- width: 20 ,
730- height: 20 ,
731- child: IgnorePointer (
732- child: Checkbox (
733- materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
734- value: _termsAccepted,
735- onChanged: (_) {},
736- ),
737- ),
738- ),
739- const SizedBox (width: 12 ),
740- Expanded (
741- child: RichText (
742- text: TextSpan (
743- style: isDesktop
744- ? STextStyles .desktopTextExtraExtraSmall (context)
745- : STextStyles .w500_14 (context),
746- children: [
747- const TextSpan (text: "I accept the " ),
748- TextSpan (
749- text: "Terms & Conditions" ,
750- style: STextStyles .richLink (
751- context,
752- ).copyWith (fontSize: isDesktop ? null : 14 ),
753- recognizer: TapGestureRecognizer ()
754- ..onTap = _openTerms,
755- ),
756- const TextSpan (text: "." ),
757- ],
758- ),
759- ),
760- ),
761- ],
762- ),
763- ),
764- ),
765720 ],
766721 );
767722
0 commit comments