Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint errors #56

Merged
merged 8 commits into from
Oct 3, 2023
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
2 changes: 0 additions & 2 deletions lib/core/animations/flip_card_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ class _FlipCardAnimationState extends State<FlipCardAnimation>
);
}

late bool _flipXAxis;
late bool _showFrontSide;

@override
void initState() {
super.initState();
_flipXAxis = true;
_showFrontSide = true;
}

Expand Down
1 change: 0 additions & 1 deletion lib/core/network/network_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ class NetworkInfo implements INetworkInfo {
@override
Future<bool> get isConnected async => await connectionChecker.hasConnection;

@override
List<Object?> get props => [];
}
17 changes: 9 additions & 8 deletions lib/core/widgets/home_page_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,7 @@ class Action extends StatelessWidget {
class Title extends StatelessWidget {
final bool isSearchEnabled;

String? searchText;
DateTime? startDate;
DateTime? endDate;

Title({Key? key, required this.isSearchEnabled}) : super(key: key);
const Title({Key? key, required this.isSearchEnabled}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -212,6 +208,10 @@ class Title extends StatelessWidget {
.extension<AppbarThemeExtensions>()!
.searchBarFillColor;

String? searchText;
DateTime? startDate;
DateTime? endDate;

void assignStartDate(DateTime date) {
startDate = date;
notesFetchCubit.fetchNotes(
Expand Down Expand Up @@ -376,12 +376,13 @@ class Title extends StatelessWidget {

class _DeleteButton extends StatelessWidget {
final int deleteCount;
late SelectableListCubit selectableListCubit;
_DeleteButton({Key? key, required this.deleteCount}) : super(key: key);

const _DeleteButton({Key? key, required this.deleteCount}) : super(key: key);

@override
Widget build(BuildContext context) {
selectableListCubit = BlocProvider.of<SelectableListCubit>(context);
final selectableListCubit = BlocProvider.of<SelectableListCubit>(context);

return BlocBuilder<NotesBloc, NotesState>(
builder: (context, state) {
NotesBloc notesBloc = BlocProvider.of<NotesBloc>(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AuthenticationRepository implements IAuthenticationRepository {
log.i("signup successful");

return Right(user);
} on DatabaseInsertionException catch (e) {
} on DatabaseInsertionException {
log.e("sign up failed becuase of database exception");

return Left(SignUpFailure.unknownError());
Expand Down Expand Up @@ -98,7 +98,7 @@ class AuthenticationRepository implements IAuthenticationRepository {
try {
await localDataSource.cacheUser(
id: user.id, email: email, password: password);
} on DatabaseInsertionException catch (e) {
} on DatabaseInsertionException {
//! silently fail for this exception, as it is not critical

log.e("caching of user into local db failed");
Expand Down
2 changes: 1 addition & 1 deletion lib/features/auth/presentation/pages/auth_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
class AuthPage extends StatefulWidget {
// user id of last logged in user to determine if it is a fresh login or not
final String? lastLoggedInUserId;
late FingerPrintAuthRepository fingerPrintAuthRepository;
late final FingerPrintAuthRepository fingerPrintAuthRepository;

AuthPage({Key? key, this.lastLoggedInUserId}) : super(key: key) {
fingerPrintAuthRepository = sl<FingerPrintAuthRepository>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Future<dynamic> emailChangePopup(
const SizedBox(height: 25),
AuthEmailInput(
autoFocus: true,
getEmailErrors: () {},
getEmailErrors: () => null,
onEmailChanged: (String email) {
changedEmail = email;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Future<void> forgotPasswordPopup(
const SizedBox(height: 25),
AuthEmailInput(
autoFocus: true,
getEmailErrors: () {},
getEmailErrors: () => null,
onEmailChanged: (String email) {
forgotPasswordEmail = email;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Future<dynamic> passwordLoginPopup(
)),
const SizedBox(height: 25),
AuthPasswordInput(
getPasswordErrors: () {},
getPasswordErrors: () => null,
onPasswordChanged: assignPassword,
autoFocus: true,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ Future<dynamic> passwordResetPopup(
color: mainTextColor)),
const SizedBox(height: 25),
AuthPasswordInput(
getPasswordErrors: () {},
getPasswordErrors: () => null,
onPasswordChanged: assignNewPassword,
autoFocus: true,
hintText: "New password",
),
const SizedBox(height: 15),
AuthPasswordInput(
getPasswordErrors: () {},
getPasswordErrors: () => null,
onPasswordChanged: assignConfirmNewPassword,
hintText: "Confirm new password",
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class SecuritySettings extends StatelessWidget {
context: context,
submitPassword: (password) =>
authenticationRepository.verifyPassword(
userId!, password),
userId, password),
);

// old password will be retrieved from previous dialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:intl/intl.dart';

class NotePreviewCard extends StatelessWidget {
late bool isSelected;
final bool first;
final bool last;
NotePreviewCard({
const NotePreviewCard({
Key? key,
required this.note,
required this.first,
Expand Down Expand Up @@ -43,7 +42,8 @@ class NotePreviewCard extends StatelessWidget {
builder: (context, state) {
final selectableListCubit =
BlocProvider.of<SelectableListCubit>(context);
isSelected = selectableListCubit.state.selectedItems.contains(note.id);
final isSelected =
selectableListCubit.state.selectedItems.contains(note.id);

return GestureDetector(
onLongPress: () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart';

class ReadOnlyEditor extends StatelessWidget {
QuillController? controller;
final QuillController? controller;
final FocusNode _focusNode = FocusNode();

ReadOnlyEditor({Key? key, required this.controller}) : super(key: key);
Expand Down