Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
IT Project 2020
Group B
pilar-mobile
Commits
5eb46815
Commit
5eb46815
authored
Nov 24, 2020
by
Tsamara Esperanti Erwin
Browse files
[REFACTOR] Add fetch on list program builder
parent
6da81493
Pipeline
#61081
passed with stages
in 17 minutes and 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/Pages/Program/bloc_program/program_bloc.dart
View file @
5eb46815
...
...
@@ -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
)
{
...
...
lib/Pages/Program/program_page.dart
View file @
5eb46815
...
...
@@ -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
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment