diff --git a/app/lib/apps/farmers/farmers.dart b/app/lib/apps/farmers/farmers.dart index 8e46fa05..b1f43bf1 100644 --- a/app/lib/apps/farmers/farmers.dart +++ b/app/lib/apps/farmers/farmers.dart @@ -27,7 +27,7 @@ class Farmers implements App { @override bool emailVerificationRequired() { - return false; + return true; } @override diff --git a/app/lib/widgets/add_farm.dart b/app/lib/widgets/add_farm.dart index 6a630034..cb1a3e3f 100644 --- a/app/lib/widgets/add_farm.dart +++ b/app/lib/widgets/add_farm.dart @@ -1,12 +1,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:threebotlogin/helpers/globals.dart'; import 'package:threebotlogin/helpers/logger.dart'; import 'package:threebotlogin/models/farm.dart'; -import 'package:threebotlogin/models/idenfy.dart'; import 'package:threebotlogin/models/wallet.dart'; import 'package:threebotlogin/services/gridproxy_service.dart'; -import 'package:threebotlogin/services/idenfy_service.dart'; import 'package:threebotlogin/services/tfchain_service.dart'; import 'package:threebotlogin/widgets/custom_dialog.dart'; @@ -75,10 +72,6 @@ class _NewFarmState extends State { _add(String farmName) async { Farm? farm; try { - final idenfyServiceUrl = Globals().idenfyServiceUrl; - final kycVerified = - await getVerificationStatus(address: _selectedWallet!.tfchainAddress, idenfyServiceUrl: idenfyServiceUrl); - if (kycVerified.status == VerificationState.VERIFIED) { final f = await createFarm(farmName, _selectedWallet!.tfchainSecret, _selectedWallet!.stellarAddress); farm = Farm( @@ -94,27 +87,6 @@ class _NewFarmState extends State { 'Farm $farmName has been added successfully', Icons.check, DialogType.Info); - } else { - saveLoading = false; - showDialog( - context: context, - builder: (BuildContext context) => CustomDialog( - type: DialogType.Warning, - image: Icons.warning, - title: 'Unauthorized', - description: - 'KYC verification is required for the selected wallet', - actions: [ - TextButton( - child: const Text('Close'), - onPressed: () { - Navigator.pop(context); - }, - ), - ], - )); - return; - } } catch (e) { logger.e(e); _showDialog('Error', 'Failed to create farm. Please try again.', diff --git a/app/lib/widgets/farm_item.dart b/app/lib/widgets/farm_item.dart index 5081fb17..2df9d074 100644 --- a/app/lib/widgets/farm_item.dart +++ b/app/lib/widgets/farm_item.dart @@ -1,15 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:threebotlogin/helpers/globals.dart'; import 'package:threebotlogin/helpers/logger.dart'; import 'package:threebotlogin/models/farm.dart'; -import 'package:threebotlogin/models/idenfy.dart'; import 'package:threebotlogin/models/wallet.dart'; import 'package:threebotlogin/screens/wallets/contacts.dart'; -import 'package:threebotlogin/services/idenfy_service.dart'; import 'package:threebotlogin/services/stellar_service.dart'; import 'package:threebotlogin/services/tfchain_service.dart'; -import 'package:threebotlogin/widgets/custom_dialog.dart'; import 'package:threebotlogin/widgets/farm_node_item.dart'; class FarmItemWidget extends StatefulWidget { @@ -34,17 +30,12 @@ class _FarmItemWidgetState extends State { ChainType chainType = ChainType.Stellar; String? addressError; String? currentAddress; - String? tfchainAddress; @override void initState() { super.initState(); currentAddress = widget.farm.walletAddress; walletAddressController.text = currentAddress!; - tfchainAddress = widget.wallets - .where((w) => w.name == widget.farm.walletName) - .first - .tfchainAddress; } @override @@ -237,32 +228,7 @@ class _FarmItemWidgetState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ IconButton( - onPressed: () async { - final idenfyServiceUrl = Globals().idenfyServiceUrl; - final kycVerified = await getVerificationStatus( - address: tfchainAddress!, idenfyServiceUrl: idenfyServiceUrl); - if (kycVerified.status != - VerificationState.VERIFIED) { - showDialog( - context: context, - builder: (BuildContext context) => - CustomDialog( - type: DialogType.Warning, - image: Icons.warning, - title: 'Unauthorized', - description: - 'KYC verification is required for the selected wallet', - actions: [ - TextButton( - child: const Text('Close'), - onPressed: () { - Navigator.pop(context); - }, - ), - ], - )); - return; - } + onPressed: () { setState(() { edit = !edit; });