Tag Archives: DependenciesAdd

To-Do App Using BLoC with MVC. Step 1: Add Dependencies Add the… | by Rohit surage | Jan, 2025

To-Do App Using BLoC with MVC. Step 1: Add Dependencies
Add the… | by Rohit surage | Jan, 2025

Step 1: Add DependenciesAdd the flutter_bloc package to your pubspec.yaml file: dependencies:flutter:sdk: flutterflutter_bloc: ^latest Step 2: Create the BLoC To-Do App with MVC Model: class Task {String name;Task(this.name);} Events: abstract class TaskEvent {}class AddTaskEvent extends TaskEvent {final String taskName;AddTaskEvent(this.taskName);}class RemoveTaskEvent extends TaskEvent {final int index;RemoveTaskEvent(this.index);} States: class TaskState {final List tasks;TaskState(this.tasks);} BLoC: import 'package:flutter_bloc/flutter_bloc.dart';import 'task_model.dart'; import 'task_event.dart';import 'task_state.dart';class TaskBloc extends …

Read More »