mirrored_repositories/Flutter_Hacktoberfest_2021/todo_provider/lib
import 'package:flutter/material.dart';
import 'package:todo_provider/models/task.dart';
import 'task_list_item.dart';

class TaskList extends StatelessWidget {
  final List<Task> tasks;

  TaskList({@required this.tasks});

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: getChildrenTasks(),
    );
  }

  List<Widget> getChildrenTasks() {
    return tasks.map((todo) => TaskListItem(task: todo)).toList();
  }
}
