forked from eatvio/eatvio_app
New screen names
This commit is contained in:
20
lib/presentation/schedule_screen/bloc/schedule_bloc.dart
Normal file
20
lib/presentation/schedule_screen/bloc/schedule_bloc.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/schedule_screen/models/schedule_model.dart';
|
||||
part 'schedule_event.dart';
|
||||
part 'schedule_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a Schedule according to the event that is dispatched to it.
|
||||
class ScheduleBloc extends Bloc<ScheduleEvent, ScheduleState> {
|
||||
ScheduleBloc(ScheduleState initialState) : super(initialState) {
|
||||
on<ScheduleInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
ScheduleInitialEvent event,
|
||||
Emitter<ScheduleState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(inputPlaceholderController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
16
lib/presentation/schedule_screen/bloc/schedule_event.dart
Normal file
16
lib/presentation/schedule_screen/bloc/schedule_event.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'schedule_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///Schedule widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class ScheduleEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the Schedule widget is first created.
|
||||
class ScheduleInitialEvent extends ScheduleEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
31
lib/presentation/schedule_screen/bloc/schedule_state.dart
Normal file
31
lib/presentation/schedule_screen/bloc/schedule_state.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'schedule_bloc.dart';
|
||||
|
||||
/// Represents the state of Schedule in the application.
|
||||
class ScheduleState extends Equatable {
|
||||
ScheduleState({
|
||||
this.inputPlaceholderController,
|
||||
this.scheduleModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? inputPlaceholderController;
|
||||
|
||||
ScheduleModel? scheduleModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
inputPlaceholderController,
|
||||
scheduleModelObj,
|
||||
];
|
||||
ScheduleState copyWith({
|
||||
TextEditingController? inputPlaceholderController,
|
||||
ScheduleModel? scheduleModelObj,
|
||||
}) {
|
||||
return ScheduleState(
|
||||
inputPlaceholderController:
|
||||
inputPlaceholderController ?? this.inputPlaceholderController,
|
||||
scheduleModelObj: scheduleModelObj ?? this.scheduleModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user