Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 2 additions & 41 deletions app/lib/screens/preference_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:threebotlogin/events/close_socket_event.dart';
import 'package:threebotlogin/events/events.dart';
import 'package:threebotlogin/helpers/environment.dart';
import 'package:threebotlogin/helpers/globals.dart';
import 'package:threebotlogin/main.dart';
import 'package:threebotlogin/helpers/logger.dart';

import 'package:threebotlogin/screens/authentication_screen.dart';
import 'package:threebotlogin/screens/change_pin_screen.dart';
Expand Down Expand Up @@ -266,45 +266,6 @@ class _PreferenceScreenState extends ConsumerState<PreferenceScreen> {
return await checkBiometricsAvailable();
}

void _showDisableFingerprint() {
Comment thread
AhmedHanafy725 marked this conversation as resolved.
showDialog(
context: context,
builder: (BuildContext context) => CustomDialog(
type: DialogType.Warning,
image: Icons.warning,
title: 'Disable Fingerprint',
description:
'Are you sure you want to deactivate fingerprint as authentication method?',
actions: <Widget>[
TextButton(
child: const Text('Cancel'),
onPressed: () async {
Navigator.pop(context);
finger = true;
await saveFingerprint(true);
setState(() {});
},
),
TextButton(
child: Text(
'Yes',
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(color: Theme.of(context).colorScheme.warning),
),
onPressed: () async {
Navigator.pop(context);
finger = false;
await saveFingerprint(false);
setState(() {});
},
),
],
),
);
}

void _showDialog({delete = false}) {
String title = 'Log Out';
String message = 'Are you sure you want to log out?';
Expand Down Expand Up @@ -349,7 +310,7 @@ class _PreferenceScreenState extends ConsumerState<PreferenceScreen> {
deleted = false;
}
} catch (e) {
print('Failed to delete user due to $e');
logger.e('Failed to delete user due to $e');
deleted = false;
}
if (deleted) {
Expand Down
3 changes: 2 additions & 1 deletion app/lib/services/idenfy_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Future<Token> getToken() async {
throw Exception('Failed to get token due to ${response.body}');
}

Future<VerificationStatus> getVerificationStatus({required String address}) async {
Future<VerificationStatus> getVerificationStatus(
{required String address}) async {
final idenfyServiceUrl = Globals().idenfyServiceUrl;

final response = await http.get(
Expand Down
1 change: 0 additions & 1 deletion app/lib/services/open_kyc_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ Future<Response> sendVerificationSms() async {
return http.post(url, body: encodedBody, headers: requestHeaders);
}

// TODO: Remove this method and use update user data
Future<Response> updateEmailAddressOfUser() async {
String timestamp = DateTime.now().millisecondsSinceEpoch.toString();
Uint8List sk = await getPrivateKey();
Expand Down
2 changes: 1 addition & 1 deletion app/lib/widgets/add_farm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _NewFarmState extends State<NewFarm> {
Icons.error, DialogType.Error);
return;
}
widget.onAddFarm(farm!);
widget.onAddFarm(farm);
if (!context.mounted) return;
Navigator.pop(context);
}
Expand Down
7 changes: 5 additions & 2 deletions app/lib/widgets/farm_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class _FarmItemWidgetState extends State<FarmItemWidget> {
super.initState();
currentAddress = widget.farm.walletAddress;
walletAddressController.text = currentAddress!;
tfchainAddress = widget.wallets.where((w)=> w.name == widget.farm.walletName).first.tfchainAddress;
tfchainAddress = widget.wallets
.where((w) => w.name == widget.farm.walletName)
.first
.tfchainAddress;
}

@override
Expand Down Expand Up @@ -182,7 +185,7 @@ class _FarmItemWidgetState extends State<FarmItemWidget> {
? IconButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ContractsScreen(
builder: (context) => ContactsScreen(
chainType: chainType,
currentWalletAddress: currentAddress!,
wallets: widget.wallets
Expand Down
1 change: 1 addition & 0 deletions app/lib/widgets/wallets/send_confirmation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class _SendConfirmationWidgetState extends State<SendConfirmationWidget> {
}
await _showDialog('Success!', 'Tokens have been transferred successfully',
Icons.check, DialogType.Info);
Navigator.pop(context);
} catch (e) {
_showDialog('Error', 'Failed to transfer. Please try again.', Icons.error,
DialogType.Error);
Expand Down