From 4f26be1f5bd40457e275fe5d2d61503dcd73d631 Mon Sep 17 00:00:00 2001 From: muttaqinrizal Date: Tue, 17 Oct 2023 09:18:35 +0700 Subject: [PATCH] fix error lint --- .../presentation/bloc/quiz_exercise_event.dart | 2 +- .../presentation/repositories/quiz_exercise.dart | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/lib/features/quiz_exercise/presentation/bloc/quiz_exercise_event.dart b/app/lib/features/quiz_exercise/presentation/bloc/quiz_exercise_event.dart index 1534308..cad15e3 100644 --- a/app/lib/features/quiz_exercise/presentation/bloc/quiz_exercise_event.dart +++ b/app/lib/features/quiz_exercise/presentation/bloc/quiz_exercise_event.dart @@ -8,5 +8,5 @@ abstract class QuizExerciseEvent extends Equatable { } class GetQuizExercise extends QuizExerciseEvent { - GetQuizExercise(); + const GetQuizExercise(); } diff --git a/app/lib/features/quiz_exercise/presentation/repositories/quiz_exercise.dart b/app/lib/features/quiz_exercise/presentation/repositories/quiz_exercise.dart index ea1352d..5262560 100644 --- a/app/lib/features/quiz_exercise/presentation/repositories/quiz_exercise.dart +++ b/app/lib/features/quiz_exercise/presentation/repositories/quiz_exercise.dart @@ -5,17 +5,15 @@ import '../model/quiz_exercise.dart'; @injectable class QuizExerciseRepository { - final _firecloud = FirebaseFirestore.instance.collection('task_set'); - Future> getAll() async { - List quizExerciseList = []; + final quizExerciseList = []; try { final result = await FirebaseFirestore.instance.collection('task_set').get(); + for (final element in result.docs) { + quizExerciseList.add(QuizExercise.fromJson(element.data())); + } - result.docs.forEach((element) { - return quizExerciseList.add(QuizExercise.fromJson(element.data())); - }); return quizExerciseList; } on FirebaseException catch (e) { if (kDebugMode) {