Fakultas Ilmu Komputer UI

Commit bba04d93 authored by Tsamara Esperanti Erwin's avatar Tsamara Esperanti Erwin 🦄
Browse files

Merge branch 'PBI-7-Progress_Program' into 'staging'

Pbi 7 progress program

See merge request !91
parents ab7d0abe 6395db57
Pipeline #61084 failed with stages
in 1 minute and 53 seconds
......@@ -46,6 +46,13 @@ class ProgramBloc extends Bloc<ProgramEvent, ProgramState> {
page: currentState.page + 1);
return;
}
if (currentState is ListProgramsSortedLoaded) {
yield ListProgramsLoaded(
programs: currentState.programs,
hasReachedMax: programs.next == null,
page: 0);
return;
}
} on DioError catch (e) {
yield ListProgramsError(error: e.response.data.toString());
} catch (e) {
......
......@@ -10,10 +10,3 @@ class FetchProgram extends ProgramEvent {
@override
List<Object> get props => [];
}
class FetchProgramByStatus extends ProgramEvent {
const FetchProgramByStatus();
@override
List<Object> get props => [];
}
......@@ -135,6 +135,10 @@ class __ListProgramState extends State<_ListProgram> {
@override
Widget build(BuildContext context) {
return BlocBuilder<ProgramBloc, ProgramState>(
bloc: ProgramBloc(
programRepository:
RepositoryProvider.of<ProgramRepository>(context))
..add(const FetchProgram()),
builder: (BuildContext context, ProgramState state) {
if (state is InitialListProgramState) {
return const Center(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment