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(
|
||||
|
||||
@@ -85,7 +85,7 @@ class _FeedScreenContentState extends State<FeedScreenContent> {
|
||||
|
||||
|
||||
|
||||
_onScrollConsultants() {
|
||||
void _onScrollConsultants() {
|
||||
if (consultantsScrollController.offset >= consultantsScrollController.position.maxScrollExtent && !consultantsScrollController.position.outOfRange) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
_comment(S s, Comment comment, [double radius = 18, bool isChild = false]) {
|
||||
Container _comment(S s, Comment comment, [double radius = 18, bool isChild = false]) {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -121,7 +121,7 @@ class ConsultantWidget extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
_badges(List<BadgeModel> badges, BuildContext context) {
|
||||
SingleChildScrollView _badges(List<BadgeModel> badges, BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
|
||||
@@ -262,7 +262,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
_iconButton(String iconPath, [String? text]) {
|
||||
Container _iconButton(String iconPath, [String? text]) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -42,7 +42,7 @@ class _TagsModalWidgetState extends State<TagsModalWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
_tagChip({
|
||||
ChoiceChip _tagChip({
|
||||
required RecipeTag tag,
|
||||
required bool isSelected,
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user