From 8c8723efd1e2dffeabbcfe3b51f107c0738c2448 Mon Sep 17 00:00:00 2001
From: vishnukvmd <vishnu@ente.io>
Date: Fri, 1 Mar 2024 18:54:10 +0530
Subject: [PATCH] Fix warnings in Auth

---
 auth/lib/core/logging/tunneled_transport.dart      | 1 +
 auth/lib/services/billing_service.dart             | 6 ------
 auth/lib/services/user_service.dart                | 1 +
 auth/lib/store/authenticator_db.dart               | 2 +-
 auth/lib/store/offline_authenticator_db.dart       | 2 +-
 auth/lib/store/user_store.dart                     | 1 +
 auth/lib/ui/account/password_entry_page.dart       | 3 +--
 auth/lib/ui/settings/data/data_section_widget.dart | 3 ---
 auth/lib/ui/settings/data/import_page.dart         | 2 +-
 9 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/auth/lib/core/logging/tunneled_transport.dart b/auth/lib/core/logging/tunneled_transport.dart
index daf8a7941..1191adc2e 100644
--- a/auth/lib/core/logging/tunneled_transport.dart
+++ b/auth/lib/core/logging/tunneled_transport.dart
@@ -27,6 +27,7 @@ class TunneledTransport implements Transport {
     _credentialBuilder = _CredentialBuilder(
       _dsn,
       _options.sentryClientName,
+      // ignore: invalid_use_of_internal_member
       _options.clock,
     );
   }
diff --git a/auth/lib/services/billing_service.dart b/auth/lib/services/billing_service.dart
index 1bb490049..75a4e5579 100644
--- a/auth/lib/services/billing_service.dart
+++ b/auth/lib/services/billing_service.dart
@@ -28,8 +28,6 @@ class BillingService {
   final _dio = Network.instance.getDio();
   final _config = Configuration.instance;
 
-  bool _isOnSubscriptionPage = false;
-
   Subscription? _cachedSubscription;
 
   Future<BillingPlans>? _future;
@@ -176,8 +174,4 @@ class BillingService {
       rethrow;
     }
   }
-
-  void setIsOnSubscriptionPage(bool isOnSubscriptionPage) {
-    _isOnSubscriptionPage = isOnSubscriptionPage;
-  }
 }
diff --git a/auth/lib/services/user_service.dart b/auth/lib/services/user_service.dart
index 49d386fec..682412744 100644
--- a/auth/lib/services/user_service.dart
+++ b/auth/lib/services/user_service.dart
@@ -486,6 +486,7 @@ class UserService {
         // ignore: need to calculate secret to get M1, unused_local_variable
         final clientS = client.calculateSecret(serverB);
         final clientM = client.calculateClientEvidenceMessage();
+        // ignore: unused_local_variable
         late Response srpCompleteResponse;
         if (setKeysRequest == null) {
           srpCompleteResponse = await _enteDio.post(
diff --git a/auth/lib/store/authenticator_db.dart b/auth/lib/store/authenticator_db.dart
index 2ad5e9c8f..0f05e83c0 100644
--- a/auth/lib/store/authenticator_db.dart
+++ b/auth/lib/store/authenticator_db.dart
@@ -166,7 +166,7 @@ class AuthenticatorDB {
         batch.delete(entityTable, where: whereID, whereArgs: [id]);
       }
     }
-    final result = await batch.commit();
+    await batch.commit();
     debugPrint("Done");
   }
 
diff --git a/auth/lib/store/offline_authenticator_db.dart b/auth/lib/store/offline_authenticator_db.dart
index 569acd396..ed8f93fb9 100644
--- a/auth/lib/store/offline_authenticator_db.dart
+++ b/auth/lib/store/offline_authenticator_db.dart
@@ -151,7 +151,7 @@ class OfflineAuthenticatorDB {
         batch.delete(entityTable, where: whereID, whereArgs: [id]);
       }
     }
-    final result = await batch.commit();
+    await batch.commit();
     debugPrint("Done");
   }
 
diff --git a/auth/lib/store/user_store.dart b/auth/lib/store/user_store.dart
index 30409671b..20f3ead72 100644
--- a/auth/lib/store/user_store.dart
+++ b/auth/lib/store/user_store.dart
@@ -3,6 +3,7 @@ import 'package:shared_preferences/shared_preferences.dart';
 class UserStore {
   UserStore._privateConstructor();
 
+  // ignore: unused_field
   late SharedPreferences _preferences;
 
   static final UserStore instance = UserStore._privateConstructor();
diff --git a/auth/lib/ui/account/password_entry_page.dart b/auth/lib/ui/account/password_entry_page.dart
index 59fd72a35..db86b1186 100644
--- a/auth/lib/ui/account/password_entry_page.dart
+++ b/auth/lib/ui/account/password_entry_page.dart
@@ -317,8 +317,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     onChanged: (cnfPassword) {
                       setState(() {
                         _passwordInInputConfirmationBox = cnfPassword;
-                        if (_passwordInInputBox != null ||
-                            _passwordInInputBox != '') {
+                        if (_passwordInInputBox != '') {
                           _passwordsMatch = _passwordInInputBox ==
                               _passwordInInputConfirmationBox;
                         }
diff --git a/auth/lib/ui/settings/data/data_section_widget.dart b/auth/lib/ui/settings/data/data_section_widget.dart
index bf494c99c..b30bf7447 100644
--- a/auth/lib/ui/settings/data/data_section_widget.dart
+++ b/auth/lib/ui/settings/data/data_section_widget.dart
@@ -9,11 +9,8 @@ import 'package:ente_auth/ui/settings/data/export_widget.dart';
 import 'package:ente_auth/ui/settings/data/import_page.dart';
 import 'package:ente_auth/utils/navigation_util.dart';
 import 'package:flutter/material.dart';
-import 'package:logging/logging.dart';
 
 class DataSectionWidget extends StatelessWidget {
-  final _logger = Logger("AccountSectionWidget");
-
   DataSectionWidget({Key? key}) : super(key: key);
 
   @override
diff --git a/auth/lib/ui/settings/data/import_page.dart b/auth/lib/ui/settings/data/import_page.dart
index a763cb855..08a4d40d8 100644
--- a/auth/lib/ui/settings/data/import_page.dart
+++ b/auth/lib/ui/settings/data/import_page.dart
@@ -21,7 +21,7 @@ enum ImportType {
 }
 
 class ImportCodePage extends StatelessWidget {
-  late List<ImportType> importOptions = [
+  final List<ImportType> importOptions = [
     ImportType.plainText,
     ImportType.encrypted,
     ImportType.twoFas,