forked from eatvio/eatvio_app
fix: fixed analyzer issues and merge conflicts
This commit is contained in:
@@ -10,11 +10,11 @@ class CommentsCubit extends Cubit<CommentsState> {
|
||||
required this.feedRepository,
|
||||
}) : super(const CommentsState());
|
||||
|
||||
setReplyId(int? replyId) {
|
||||
void setReplyId(int? replyId) {
|
||||
emit((state as CommentsStateLoaded).copyWith(replyId: replyId));
|
||||
}
|
||||
|
||||
getComments(String id, CommentSourceType commentSourceType, [bool isFirstFetch = false]) async {
|
||||
Future<void> getComments(String id, CommentSourceType commentSourceType, [bool isFirstFetch = false]) async {
|
||||
if (isFirstFetch) emit(const CommentsState.loading());
|
||||
try {
|
||||
switch (commentSourceType) {
|
||||
@@ -36,7 +36,7 @@ class CommentsCubit extends Cubit<CommentsState> {
|
||||
}
|
||||
}
|
||||
|
||||
sendComment({
|
||||
Future<void> sendComment({
|
||||
required String id,
|
||||
required String commentText,
|
||||
required CommentSourceType commentSourceType,
|
||||
|
||||
@@ -11,7 +11,7 @@ class ConsultantsCubit extends Cubit<ConsultantsState> {
|
||||
required this.feedRepository,
|
||||
}) : super(const ConsultantsState());
|
||||
|
||||
getConsultants() async {
|
||||
Future<void> getConsultants() async {
|
||||
emit(const ConsultantsState.loading());
|
||||
try {
|
||||
emit(
|
||||
|
||||
@@ -86,7 +86,7 @@ class DietsCubit extends Cubit<DietsState> {
|
||||
);
|
||||
}
|
||||
|
||||
loadDiets({
|
||||
Future<void> loadDiets({
|
||||
String? query,
|
||||
}) async {
|
||||
try {
|
||||
|
||||
@@ -16,7 +16,7 @@ class FeedCubit extends Cubit<FeedState> {
|
||||
required this.feedRepository,
|
||||
}) : super(const FeedState.loading());
|
||||
|
||||
updateFeedBlogPostList(FeedBlogPostModel? feedBlogPostModel, bool wasLikedByMe) {
|
||||
void updateFeedBlogPostList(FeedBlogPostModel? feedBlogPostModel, bool wasLikedByMe) {
|
||||
if (feedBlogPostModel == null) return;
|
||||
List<FeedBlogPostModel> feedBlogPostList = [...(state as FeedStateLoaded).feedBlogPostList];
|
||||
final int index = feedBlogPostList.indexOf(feedBlogPostModel);
|
||||
@@ -32,7 +32,7 @@ class FeedCubit extends Cubit<FeedState> {
|
||||
);
|
||||
}
|
||||
|
||||
loadFeedBlogPostList({
|
||||
Future<void> loadFeedBlogPostList({
|
||||
String? query,
|
||||
}) async {
|
||||
try {
|
||||
@@ -80,7 +80,7 @@ class FeedCubit extends Cubit<FeedState> {
|
||||
}
|
||||
}
|
||||
|
||||
likePost(int id) async {
|
||||
Future<void> likePost(int id) async {
|
||||
try {
|
||||
await feedRepository.likeBlogPost(id: id);
|
||||
} catch (e, st) {
|
||||
@@ -88,10 +88,10 @@ class FeedCubit extends Cubit<FeedState> {
|
||||
}
|
||||
}
|
||||
|
||||
unlikedPost(int id) async => await feedRepository.unlikedBlogPost(id: id);
|
||||
Future<void> unlikedPost(int id) async => await feedRepository.unlikedBlogPost(id: id);
|
||||
|
||||
viewPost(int id) async => await feedRepository.viewPost(id);
|
||||
viewRecipe(String slug) async => await feedRepository.viewRecipe(slug);
|
||||
viewDiet(int id) async => await feedRepository.viewDiet(id);
|
||||
viewPlan(String slug) async => await feedRepository.viewPlan(slug);
|
||||
Future<void> viewPost(int id) async => await feedRepository.viewPost(id);
|
||||
Future<void> viewRecipe(String slug) async => await feedRepository.viewRecipe(slug);
|
||||
Future<void> viewDiet(int id) async => await feedRepository.viewDiet(id);
|
||||
Future<void> viewPlan(String slug) async => await feedRepository.viewPlan(slug);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class PlansCubit extends Cubit<PlansState> {
|
||||
);
|
||||
}
|
||||
|
||||
loadPlans({
|
||||
Future<void> loadPlans({
|
||||
String? query,
|
||||
}) async {
|
||||
try {
|
||||
|
||||
@@ -40,7 +40,7 @@ class RecipesCubit extends Cubit<RecipesState> {
|
||||
});
|
||||
}
|
||||
|
||||
loadRecipesList({
|
||||
Future<void> loadRecipesList({
|
||||
String? query,
|
||||
}) async {
|
||||
try {
|
||||
@@ -99,7 +99,7 @@ class RecipesCubit extends Cubit<RecipesState> {
|
||||
}
|
||||
}
|
||||
|
||||
updateTags(RecipeTag tag) {
|
||||
void updateTags(RecipeTag tag) {
|
||||
_selectedTags.contains(tag.id) ? _selectedTags.remove(tag.id) : _selectedTags.add(tag.id);
|
||||
emit(
|
||||
state.copyWith(
|
||||
|
||||
Reference in New Issue
Block a user