Skip to content

Commit

Permalink
fix: linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: Aman <[email protected]>
  • Loading branch information
aman-singh7 committed Aug 25, 2023
1 parent 4a91ecb commit 44f9193
Show file tree
Hide file tree
Showing 25 changed files with 208 additions and 419 deletions.
9 changes: 5 additions & 4 deletions lib/domain/repositories/coupon_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import 'package:appetizer/data/services/remote/api_service.dart';
import 'package:appetizer/domain/models/coupon/coupon.dart';
import 'package:appetizer/domain/models/failure_model.dart';
import 'package:appetizer/domain/models/menu/week_menu.dart';
import 'package:flutter/foundation.dart';

class CouponRepositroy {
class CouponRepository {
final ApiService _apiService;

CouponRepositroy(this._apiService);
CouponRepository(this._apiService);

Future<CouponStatus> applyForCoupon(Coupon coupon) async {
Map<String, dynamic> map = {
Expand All @@ -17,7 +18,7 @@ class CouponRepositroy {
try {
return await _apiService.applyForCoupon(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -29,7 +30,7 @@ class CouponRepositroy {
try {
return await _apiService.cancelCoupon(coupon.meal, map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand Down
7 changes: 4 additions & 3 deletions lib/domain/repositories/feedback_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:appetizer/data/services/remote/api_service.dart';
import 'package:appetizer/domain/models/failure_model.dart';
import 'package:appetizer/domain/models/feedback/appetizer_feedback.dart';
import 'package:appetizer/domain/models/feedback/feedback_response.dart';
import 'package:flutter/foundation.dart';

class FeedbackRepository {
final ApiService _apiService;
Expand All @@ -13,7 +14,7 @@ class FeedbackRepository {
try {
return await _apiService.submittedFeedbacks();
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -22,7 +23,7 @@ class FeedbackRepository {
try {
return await _apiService.responseOfFeedbacks();
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -37,7 +38,7 @@ class FeedbackRepository {
try {
return await _apiService.newFeedback(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand Down
11 changes: 6 additions & 5 deletions lib/domain/repositories/leave_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import 'package:appetizer/data/services/remote/api_service.dart';
import 'package:appetizer/domain/models/failure_model.dart';
import 'package:appetizer/domain/models/leaves/paginated_leaves.dart';
import 'package:appetizer/domain/models/menu/week_menu.dart';
import 'package:flutter/foundation.dart';

class LeaveRepository {
ApiService _apiService;
final ApiService _apiService;

LeaveRepository(this._apiService);

Expand Down Expand Up @@ -40,7 +41,7 @@ class LeaveRepository {
try {
return await _apiService.check(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -52,7 +53,7 @@ class LeaveRepository {
try {
return await _apiService.check(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -66,7 +67,7 @@ class LeaveRepository {
try {
return await _apiService.leave(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -77,7 +78,7 @@ class LeaveRepository {
try {
return await _apiService.cancelLeave(meal.id);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand Down
13 changes: 7 additions & 6 deletions lib/domain/repositories/menu_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import 'package:appetizer/data/constants/constants.dart';
import 'package:appetizer/data/services/remote/api_service.dart';
import 'package:appetizer/domain/models/failure_model.dart';
import 'package:appetizer/domain/models/menu/week_menu.dart';
import 'package:flutter/foundation.dart';

class MenuRepository {
ApiService _apiService;
final ApiService _apiService;

MenuRepository(this._apiService);

Expand All @@ -14,7 +15,7 @@ class MenuRepository {
try {
return await _apiService.weekMenuMultimessing(hostelCode, id);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -23,7 +24,7 @@ class MenuRepository {
try {
return await _apiService.weekMenuForYourMeals(weekId);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -34,7 +35,7 @@ class MenuRepository {
try {
return await _apiService.weekMenuByWeekId(weekId);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -43,7 +44,7 @@ class MenuRepository {
try {
return await _apiService.currentWeekMenu();
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -52,7 +53,7 @@ class MenuRepository {
try {
return await _apiService.dayMenu(week, dayOfWeek);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand Down
9 changes: 5 additions & 4 deletions lib/domain/repositories/transaction_repositroy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import 'package:appetizer/data/services/remote/api_service.dart';
import 'package:appetizer/domain/models/failure_model.dart';
import 'package:appetizer/domain/models/transaction/faq.dart';
import 'package:appetizer/domain/models/transaction/paginated_yearly_rebate.dart';
import 'package:flutter/foundation.dart';

class TransactionRepository {
ApiService _apiService;
final ApiService _apiService;

TransactionRepository(this._apiService);

Expand All @@ -15,7 +16,7 @@ class TransactionRepository {
try {
return await _apiService.getMonthlyRebate();
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -24,7 +25,7 @@ class TransactionRepository {
try {
return await _apiService.getYearlyRebate(year);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -33,7 +34,7 @@ class TransactionRepository {
try {
return await _apiService.getFAQs();
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand Down
23 changes: 12 additions & 11 deletions lib/domain/repositories/user_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import 'package:appetizer/domain/models/failure_model.dart';
import 'package:appetizer/domain/models/user/notification.dart';
import 'package:appetizer/domain/models/user/oauth_user.dart';
import 'package:appetizer/domain/models/user/user.dart';
import 'package:flutter/foundation.dart';

class UserRepository {
ApiService _apiService;
final ApiService _apiService;

UserRepository(this._apiService);

Expand All @@ -20,7 +21,7 @@ class UserRepository {
try {
return await _apiService.login(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -29,7 +30,7 @@ class UserRepository {
try {
return await _apiService.logout();
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -38,7 +39,7 @@ class UserRepository {
try {
return await _apiService.getCurrentUser();
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -47,7 +48,7 @@ class UserRepository {
try {
return await _apiService.updateUser(user);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -60,7 +61,7 @@ class UserRepository {
try {
return await _apiService.updateFcmTokenForUser(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -73,7 +74,7 @@ class UserRepository {
try {
return await _apiService.changePassword(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -85,7 +86,7 @@ class UserRepository {
try {
return await _apiService.resetPassword(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -94,7 +95,7 @@ class UserRepository {
try {
return await _apiService.oAuthRedirect(code);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -109,7 +110,7 @@ class UserRepository {
try {
return await _apiService.oAuthComplete(map);
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand All @@ -118,7 +119,7 @@ class UserRepository {
try {
return await _apiService.getNotifications();
} catch (e) {
print(e);
debugPrint(e.toString());
throw Failure(AppConstants.GENERIC_FAILURE);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class _AppetizerAppState extends State<AppetizerApp> {
@override
Widget build(BuildContext context) {
return MultiRepositoryProvider(
providers: [],
providers: const [],
child: BlocBuilder<AppBloc, AppState>(
builder: (context, state) {
return MaterialApp.router(
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/components/black_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BlackButton extends StatelessWidget {
title,
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFFF6F6F6),
color: const Color(0xFFF6F6F6),
fontSize: 12.toAutoScaledFont,
fontFamily: 'Lato',
fontWeight: FontWeight.w700,
Expand Down
1 change: 0 additions & 1 deletion lib/presentation/components/no_data_found_container.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:appetizer/data/core/theme/dimensional/dimensional.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_svg_provider/flutter_svg_provider.dart';

class NoDataFoundContainer extends StatelessWidget {
const NoDataFoundContainer({
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/coupons/components/coupon_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CouponCard extends StatelessWidget {
Text(
coupon.meal,
style: TextStyle(
color: Color(0xFF2E2E2E),
color: const Color(0xFF2E2E2E),
fontSize: 10.toAutoScaledFont,
fontFamily: 'Noto Sans',
fontWeight: FontWeight.w400,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';

part 'feedback_tile_event.dart';
part 'feedback_tile_state.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
part of 'feedback_tile_bloc.dart';

@immutable
abstract class FeedbackTileEvent extends Equatable {
const FeedbackTileEvent();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FeedbackTile extends StatelessWidget {
title,
textAlign: TextAlign.left,
style: TextStyle(
color: Color(0xFF111111),
color: const Color(0xFF111111),
fontSize: 20.toAutoScaledFont,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
Expand Down
Loading

0 comments on commit 44f9193

Please sign in to comment.