@@ -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' ;
@@ -33,7 +31,6 @@ import '../../widgets/desktop/primary_button.dart';
3331import '../../widgets/desktop/secondary_button.dart' ;
3432import '../../widgets/rounded_white_container.dart' ;
3533import 'shopinbit_send_from_view.dart' ;
36- import 'shopinbit_tickets_view.dart' ;
3734
3835class ShopInBitPaymentView extends ConsumerStatefulWidget {
3936 const ShopInBitPaymentView ({super .key, required this .model});
@@ -48,7 +45,6 @@ class ShopInBitPaymentView extends ConsumerStatefulWidget {
4845}
4946
5047class _ShopInBitPaymentViewState extends ConsumerState <ShopInBitPaymentView > {
51- bool _termsAccepted = false ;
5248 bool _loading = false ;
5349 int _selectedMethod = 0 ;
5450 Timer ? _pollTimer;
@@ -76,8 +72,7 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
7672 'payment_processing' ,
7773 }.contains (_status);
7874
79- bool get _payNowEnabled =>
80- _termsAccepted && ! _isExpiredOrInvalid && ! _isTerminal;
75+ bool get _payNowEnabled => ! _isExpiredOrInvalid && ! _isTerminal;
8176
8277 @override
8378 void initState () {
@@ -160,11 +155,6 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
160155 }
161156 }
162157
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-
168158 Future <void > _checkForPayment () async {
169159 _pollTimer? .cancel ();
170160 setState (() => _loading = true );
@@ -334,6 +324,14 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
334324 Navigator .of (context).pop ();
335325 }
336326
327+ void _navigateToTickets () {
328+ if (Util .isDesktop) {
329+ Navigator .of (context, rootNavigator: true ).pop ();
330+ } else {
331+ Navigator .of (context).popUntil ((route) => route.isFirst);
332+ }
333+ }
334+
337335 void _navigateToSendFrom ({
338336 required CryptoCurrency coin,
339337 required Amount ? amount,
@@ -469,16 +467,6 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
469467 );
470468 }
471469
472- void _copyAddress (BuildContext context) {
473- Clipboard .setData (ClipboardData (text: _currentAddress));
474- showFloatingFlushBar (
475- type: FlushBarType .info,
476- message: "Copied to clipboard" ,
477- iconAsset: Assets .svg.copy,
478- context: context,
479- );
480- }
481-
482470 @override
483471 Widget build (BuildContext context) {
484472 final isDesktop = Util .isDesktop;
@@ -709,59 +697,15 @@ class _ShopInBitPaymentViewState extends ConsumerState<ShopInBitPaymentView> {
709697 ],
710698 ),
711699 ),
700+ SizedBox (height: isDesktop ? 16 : 12 ),
701+ PrimaryButton (
702+ label: "View My Requests" ,
703+ onPressed: _navigateToTickets,
704+ ),
712705 ],
713706 SizedBox (height: isDesktop ? 24 : 16 ),
714707 // Coin list (replaces tab selector + QR + address + global button)
715708 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- ),
765709 ],
766710 );
767711
0 commit comments