Skip to content

Commit adc886c

Browse files
feat:removed warnings
1 parent ba63f6b commit adc886c

13 files changed

Lines changed: 50 additions & 44 deletions

lib/feedback.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class FeedbackPage extends StatefulWidget {
88

99
class _FeedbackPageState extends State<FeedbackPage> {
1010
TextEditingController _commentController = TextEditingController();
11-
double _rating = 0.0;
12-
bool _alreadyRated = false;
11+
double rating = 0.0;
12+
bool alreadyRated = false;
1313

1414
@override
1515
void initState() {
@@ -21,13 +21,13 @@ class _FeedbackPageState extends State<FeedbackPage> {
2121
SharedPreferences prefs = await SharedPreferences.getInstance();
2222
bool alreadyRated = prefs.getBool('already_rated') ?? false;
2323
setState(() {
24-
_alreadyRated = alreadyRated;
24+
alreadyRated = alreadyRated;
2525
});
2626
}
2727

2828
void _submitFeedback() {
2929
// Submit the feedback to your backend service or database
30-
String comment = _commentController.text;
30+
// String comment = _commentController.text;
3131
// Store the feedback and rating
3232

3333
// Update the alreadyRated flag
@@ -71,7 +71,7 @@ class _FeedbackPageState extends State<FeedbackPage> {
7171
RatingBar(
7272
onRatingChanged: (rating) {
7373
setState(() {
74-
_rating = rating;
74+
rating = rating;
7575
});
7676
},
7777
),
@@ -118,4 +118,4 @@ class _RatingBarState extends State<RatingBar> {
118118
children: List.generate(5, (index) => _buildStar(index + 1)),
119119
);
120120
}
121-
}
121+
}

lib/screens/contact_us_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class _ContactUsScreenState extends State<ContactUsScreen> {
3939
physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
4040
child: Consumer<UserInfoServices>(
4141
builder: (context, userInfo, _) {
42+
// ignore: unused_local_variable
4243
Users user;
4344
if (userInfo.hasData) user = userInfo.user!;
4445
return Stack(alignment: Alignment.center, children: [

lib/screens/faqs_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class FAQScreen extends StatelessWidget {
1919
physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
2020
child: Consumer<UserInfoServices>(
2121
builder: (context, userInfo, _) {
22+
// ignore: unused_local_variable
2223
Users _user;
2324
if (userInfo.hasData) _user = userInfo.user!;
2425
return Stack(alignment: Alignment.center, children: [

lib/screens/help_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class HelpScreen extends StatelessWidget {
2121
physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
2222
child: Consumer<UserInfoServices>(
2323
builder: (context, userInfo, _) {
24+
// ignore: unused_local_variable
2425
Users _user;
2526
if (userInfo.hasData) _user = userInfo.user!;
2627
return Stack(alignment: Alignment.center, children: [

lib/screens/profile_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
127127
physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
128128
child: Consumer<UserInfoServices>(
129129
builder: (context, userInfo, _) {
130+
// ignore: unused_local_variable
130131
Users _user;
131132
if (userInfo.hasData) _user = userInfo.user!;
132133
return Stack(

lib/screens/settings_screen.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@ class _SettingsScreenState extends State<SettingsScreen> {
2424
bool modeval = false;
2525

2626
late bool? notification;
27-
ThemeData? _currentTheme;
27+
ThemeData? currentTheme;
2828

2929
void _setTheme(ThemeData? theme) {
3030
if (theme != null) {
3131
setState(() {
32-
_currentTheme = theme;
32+
currentTheme = theme;
3333
});
3434
}
3535
}
3636

3737
@override
3838
void initState() {
39-
// TODO: implement initState
4039
checknotify();
41-
_currentTheme =
42-
ThemeMode.system == ThemeMode.light ? lightTheme : darkTheme;
40+
currentTheme = ThemeMode.system == ThemeMode.light ? lightTheme : darkTheme;
4341
super.initState();
4442
}
4543

@@ -86,6 +84,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
8684
physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
8785
child: Consumer<UserInfoServices>(
8886
builder: (context, userInfo, _) {
87+
// ignore: unused_local_variable
8988
Users _user;
9089
if (userInfo.hasData) _user = userInfo.user!;
9190
return Stack(

lib/services/auth_error_msg_toast.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:fluttertoast/fluttertoast.dart';
33

44
void showErrToast(String errorMsg, FToast errToast) {
5+
// ignore: unnecessary_null_comparison
56
if (errorMsg == null) return;
67
Widget toast = Container(
78
padding: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),

lib/services/authentication.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ class AuthenticationService {
2121
return OnboardingPage();
2222
} else {
2323
return AuthHandlingWidget(
24-
key: UniqueKey(),
25-
name: _currUser.displayName ?? '',
26-
email: _currUser.email?? '',
27-
);
24+
key: UniqueKey(),
25+
name: _currUser.displayName ?? '',
26+
email: _currUser.email ?? '',
27+
);
28+
}
2829
}
29-
}
3030

3131
/// Handles Authentication Login
3232
static Future<String> handleLogin(
@@ -41,6 +41,7 @@ class AuthenticationService {
4141
final User? currentUser = auth.currentUser;
4242

4343
if (user!.emailVerified) {
44+
// ignore: unnecessary_null_comparison
4445
if ((user != null) &&
4546
(currentUser != null) &&
4647
(user.uid == currentUser.uid)) {
@@ -177,10 +178,7 @@ class AuthenticationService {
177178
.signOut(); // Without that, If User Sign-Up, then close and reopen the app, can navigate to the
178179
//bottom_navigation screen
179180

180-
Navigator.push(
181-
context,
182-
MaterialPageRoute(builder: (_) => LoginPage())
183-
);
181+
Navigator.push(context, MaterialPageRoute(builder: (_) => LoginPage()));
184182
} else {
185183
print("SignUp Error: Undefined Error!");
186184
errorMsg = "Undefined Error Occurred";
@@ -201,6 +199,7 @@ class AuthenticationService {
201199
final FirebaseAuth auth = FirebaseAuth.instance;
202200
User? _currUser = auth.currentUser;
203201
print("Signing Out: " + _currUser!.uid);
202+
// ignore: unnecessary_null_comparison
204203
if (_currUser != null) {
205204
await auth.signOut();
206205
// Navigate to Onboarding Page

lib/services/chats_db.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Future<void> searchUsersByIdAndPerformActions(
4848
.get();
4949

5050
if (snapshot.docs.isNotEmpty) {
51-
DocumentSnapshot userSnapshot = snapshot.docs.first;
52-
String userName = userSnapshot['name'];
51+
// DocumentSnapshot userSnapshot = snapshot.docs.first;
52+
// String userName = userSnapshot['name'];
5353

5454
// Create a new group
5555
createGroup(groupId, userId).then((groupId) {

lib/services/phone_number_verification_db.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import 'package:firebase_auth/firebase_auth.dart';
22

33
class PhoneNumberVerificationDb {
44
final FirebaseAuth _auth = FirebaseAuth.instance;
5-
5+
66
var verificationCallback;
77

88
PhoneNumberVerificationDb({required this.verificationCallback});
99

10-
Future<void> verifyPhoneNumber(String phoneNumber, verifyCodeScreenCallback) async {
10+
Future<void> verifyPhoneNumber(
11+
String phoneNumber, verifyCodeScreenCallback) async {
1112
await _auth.verifyPhoneNumber(
1213
phoneNumber: phoneNumber,
1314
verificationCompleted: (PhoneAuthCredential credential) async {
@@ -18,10 +19,9 @@ class PhoneNumberVerificationDb {
1819
},
1920
codeSent: (String verificationId, int? resendToken) {
2021
print('Verification Code Sent to $phoneNumber');
21-
// Call a function in VerifyCodeScreen to pass the verification ID
22-
// and navigate to the VerifyCodeScreen.
23-
codeSent: (String verificationId, int? resendToken) {
24-
print('Verification Code Sent to $phoneNumber');
22+
// ignore: unnecessary_statements
23+
(String verificationId, int? resendToken) {
24+
print('Verification Code Sent to $phoneNumber');
2525
};
2626
},
2727
codeAutoRetrievalTimeout: (String verificationId) {
@@ -41,7 +41,8 @@ class PhoneNumberVerificationDb {
4141

4242
Future<void> _signInWithCredential(PhoneAuthCredential credential) async {
4343
try {
44-
final UserCredential userCredential = await _auth.signInWithCredential(credential);
44+
final UserCredential userCredential =
45+
await _auth.signInWithCredential(credential);
4546
final User? user = userCredential.user;
4647
if (user != null) {
4748
print('Phone Number Verified: ${user.phoneNumber}');

0 commit comments

Comments
 (0)