Skip to content

Commit

Permalink
fix error lint
Browse files Browse the repository at this point in the history
  • Loading branch information
muttaqinrizal committed Oct 17, 2023
1 parent 2cded53 commit 4f26be1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ abstract class QuizExerciseEvent extends Equatable {
}

class GetQuizExercise extends QuizExerciseEvent {
GetQuizExercise();
const GetQuizExercise();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ import '../model/quiz_exercise.dart';

@injectable
class QuizExerciseRepository {
final _firecloud = FirebaseFirestore.instance.collection('task_set');

Future<List<QuizExercise>> getAll() async {
List<QuizExercise> quizExerciseList = [];
final quizExerciseList = <QuizExercise>[];
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) {
Expand Down

0 comments on commit 4f26be1

Please sign in to comment.