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
PPL Sosial
bisago
bisago-fe
Commits
90e16786
Commit
90e16786
authored
Jun 07, 2021
by
Ardian Ghifari
Browse files
[GREEN] Add shimmer loading effect to list_sekolah.dart
parent
07f000f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/page/informasi/list_sekolah.dart
View file @
90e16786
...
...
@@ -8,6 +8,7 @@ import 'package:bisaGo/page/informasi/detail_komunitas.dart';
import
'package:bisaGo/page/informasi/detail_sekolah.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:shimmer/shimmer.dart'
;
class
ListSekolah
extends
StatefulWidget
{
const
ListSekolah
({
Key
key
})
:
super
(
key:
key
);
...
...
@@ -17,11 +18,21 @@ class ListSekolah extends StatefulWidget {
}
class
_ListSekolahState
extends
State
<
ListSekolah
>
{
/// Search Icon for textFormField
Icon
searchIcon
=
const
Icon
(
Icons
.
search
);
LayananBloc
layanan_bloc
=
LayananBloc
();
bool
_enabled
=
true
;
final
mockSekolah
=
SekolahModel
.
fromJson
({
'name'
:
'SMA Tanjung Barat'
,
'alamat'
:
'Kecamatan Tanjung Barat'
,
'no_telp'
:
'0213425367'
,
'website'
:
'www.tanjungbarat.co.id'
,
'jumlah_siswa'
:
200
,
'status'
:
'IT'
,
'jenis_sekolah'
:
'IK'
,
'akreditasi'
:
'A'
,
});
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -94,14 +105,17 @@ class _ListSekolahState extends State<ListSekolah> {
if
(
snapshot
.
hasData
)
{
switch
(
snapshot
.
data
.
status
)
{
case
Status
.
loading
:
return
const
Center
(
child:
CircularProgressIndicator
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
greenPrimary
),
),
);
_enabled
=
true
;
return
Column
(
children:
[
Shimmer
.
fromColors
(
baseColor:
Colors
.
grey
[
300
],
highlightColor:
Colors
.
grey
[
100
],
enabled:
_enabled
,
child:
makeSekolahWidget
(
'sekolah'
,
mockSekolah
))
]);
break
;
case
Status
.
completed
:
_enabled
=
false
;
var
layanan
=
snapshot
.
data
.
data
;
return
Column
(
children:
layanan
.
map
<
Widget
>((
each
)
{
...
...
@@ -116,6 +130,7 @@ class _ListSekolahState extends State<ListSekolah> {
);
break
;
case
Status
.
error
:
_enabled
=
false
;
return
Center
(
child:
Text
(
snapshot
.
data
.
data
.
toString
()),
);
...
...
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