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
2020
PPL-C
DTB-Layanan Fasilitas Publik Penyandang Disabilitas
PoiPoLeGan-PPLapanganTembak-DTB Layanan Fasilitas Publik Penyandang Disabilitas-FE
Commits
04407712
Commit
04407712
authored
Mar 18, 2020
by
Adzkia Aisyah Afrah Hardian
Browse files
[REFACTOR] change to single quotes & document
parent
c2e15d17
Pipeline
#36742
passed with stages
in 4 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/page/pencarian/pencarian.dart
View file @
04407712
import
"
package:flutter/material.dart
"
;
import
"
package:ppl_disabilitas/config/styles.dart
"
;
import
"
package:ppl_disabilitas/network/data/network_model.dart
"
;
import
"
package:ppl_disabilitas/network/network_interface.dart
"
;
import
'
package:flutter/material.dart
'
;
import
'
package:ppl_disabilitas/config/styles.dart
'
;
import
'
package:ppl_disabilitas/network/data/network_model.dart
'
;
import
'
package:ppl_disabilitas/network/network_interface.dart
'
;
/// Create Pencarian page widget with a state
class
Pencarian
extends
StatefulWidget
{
@override
PencarianState
createState
()
=
>
PencarianState
();
...
...
@@ -11,7 +12,7 @@ class Pencarian extends StatefulWidget {
class
PencarianState
extends
State
<
Pencarian
>
{
final
myController
=
TextEditingController
();
Icon
searchIcon
=
Icon
(
Icons
.
search
);
Widget
appBarText
=
Text
(
"
Pencarian Lokasi
"
);
Widget
appBarText
=
Text
(
'
Pencarian Lokasi
'
);
NetworkInterface
networkInterface
=
NetworkInterface
();
List
places
=
[];
List
currentSearch
=
[];
...
...
@@ -31,246 +32,129 @@ class PencarianState extends State<Pencarian> {
}
setState
(()
{
currentSearch
=
tempList
;
print
(
"curretSearch:
$currentSearch
"
);
});
});
super
.
initState
();
print
(
"aku"
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
backgroundColor:
greenPrimary
,
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back_ios
,
size:
25
),
key:
Key
(
"Back Icon Key"
),
onPressed:
()
=
>
Navigator
.
pop
(
context
,
'Take me back'
)),
title:
Container
(
margin:
EdgeInsets
.
only
(
top:
doubleSpace
,
bottom:
doubleSpace
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
doubleBorderRadius
,
boxShadow:
regularShadow
),
child:
TextFormField
(
controller:
myController
,
key:
Key
(
"Text Field Mau Kemana"
),
decoration:
InputDecoration
(
contentPadding:
EdgeInsets
.
all
(
0
),
isDense:
false
,
prefixIcon:
Icon
(
Icons
.
search
,
color:
greenPrimary
,
size:
25
,
),
border:
InputBorder
.
none
,
fillColor:
Colors
.
white
,
labelText:
'Kamu mau kemana?'
,
labelStyle:
TextStyle
(
appBar:
AppBar
(
backgroundColor:
greenPrimary
,
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back_ios
,
size:
25
),
key:
Key
(
'Back Icon Key'
),
onPressed:
()
=
>
Navigator
.
pop
(
context
,
'Take me back'
)),
title:
Container
(
margin:
EdgeInsets
.
only
(
top:
doubleSpace
,
bottom:
doubleSpace
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
doubleBorderRadius
,
boxShadow:
regularShadow
),
child:
TextFormField
(
controller:
myController
,
key:
Key
(
'Text Field Mau Kemana'
),
decoration:
InputDecoration
(
contentPadding:
EdgeInsets
.
all
(
0
),
isDense:
false
,
prefixIcon:
Icon
(
Icons
.
search
,
color:
greenPrimary
,
fontSize:
18
,
fontFamily:
'Muli'
,
fontWeight:
FontWeight
.
w700
),
suffixIcon:
IconButton
(
size:
25
,
),
border:
InputBorder
.
none
,
fillColor:
Colors
.
white
,
labelText:
'Kamu mau kemana?'
,
labelStyle:
TextStyle
(
color:
greenPrimary
,
fontSize:
18
,
fontFamily:
'Muli'
,
fontWeight:
FontWeight
.
w700
),
suffixIcon:
IconButton
(
icon:
Icon
(
Icons
.
mic
,
color:
greenPrimary
,
size:
25
,
),
onPressed:
()
{})),
),
onPressed:
()
{},
)),
),
),
),
),
body:
Stack
(
children:
[
FutureBuilder
<
NetworkModel
>(
future:
data
,
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
hasData
)
{
print
(
"snapshot data"
);
places
=
snapshot
.
data
.
response
;
return
Container
();
}
else
if
(
snapshot
.
hasError
)
{
return
Text
(
"
${snapshot.error}
"
);
}
body:
Stack
(
children:
[
FutureBuilder
<
NetworkModel
>(
future:
data
,
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
hasData
)
{
places
=
snapshot
.
data
.
response
;
return
Container
();
}
else
if
(
snapshot
.
hasError
)
{
return
Text
(
'
${snapshot.error}
'
);
}
// By default, show a loading spinner.
return
CircularProgressIndicator
();
},
),
ListView
.
builder
(
itemCount:
currentSearch
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
transparent
,
border:
Border
(
bottom:
BorderSide
(
color:
Colors
.
grey
[
400
]))),
margin:
EdgeInsets
.
only
(
left:
doubleSpace
,
right:
doubleSpace
),
height:
90
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
Row
(
children:
<
Widget
>[
CircleAvatar
(
backgroundColor:
greenPrimary
,
child:
Text
(
'Test'
),
),
Container
(
padding:
EdgeInsets
.
all
(
doubleSpace
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
currentSearch
[
index
][
'nama'
],
key:
Key
(
"Result text"
),
style:
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
w800
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
),
// By default, show a loading spinner.
return
CircularProgressIndicator
();
},
),
ListView
.
builder
(
itemCount:
currentSearch
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
transparent
,
border:
Border
(
bottom:
BorderSide
(
color:
Colors
.
grey
[
400
]))),
margin:
EdgeInsets
.
only
(
left:
doubleSpace
,
right:
doubleSpace
),
height:
90
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
Row
(
children:
<
Widget
>[
CircleAvatar
(
backgroundColor:
greenPrimary
,
child:
Text
(
'Test'
),
),
Container
(
padding:
EdgeInsets
.
all
(
doubleSpace
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
currentSearch
[
index
][
'nama'
],
key:
Key
(
'Result text'
),
style:
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
w800
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
),
Text
(
currentSearch
[
index
][
'alamat'
],
style:
TextStyle
(
fontSize:
15
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
)
,
),
Text
(
currentSearch
[
index
][
'alamat'
],
style:
TextStyle
(
fontSize:
15
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
),
]
,
)
,
)
,
]
,
),
],
),
Icon
(
Icons
.
arrow_forward_ios
,
color:
Colors
.
grey
[
400
],
size:
20
,
)
],
),
);
})
]));
}
ListView
temp
=
ListView
(
padding:
const
EdgeInsets
.
all
(
8
),
children:
<
Widget
>[
Padding
(
padding:
EdgeInsets
.
only
(
left:
doubleSpace
,
top:
10
),
child:
Text
(
'Hasil Pencarian'
,
style:
TextStyle
(
fontSize:
15
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
),
),
),
Container
(
height:
90
,
color:
Colors
.
transparent
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
CircleAvatar
(
backgroundColor:
greenPrimary
,
child:
Text
(
'Test'
),
),
Padding
(
padding:
EdgeInsets
.
all
(
doubleSpace
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
'Margo City'
,
style:
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
w800
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
),
),
],
),
Icon
(
Icons
.
arrow_forward_ios
,
color:
Colors
.
grey
[
400
],
size:
20
,
)
],
),
Text
(
'Jl. Margonda Raya No.358, Kemir...'
,
style:
TextStyle
(
fontSize:
15
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
),
),
],
),
),
Icon
(
Icons
.
arrow_forward_ios
,
color:
Colors
.
grey
[
400
],
size:
20
,
)
],
),
),
Container
(
decoration:
BoxDecoration
(
border:
Border
(
top:
BorderSide
(
color:
Colors
.
grey
[
400
]))),
),
Container
(
height:
90
,
color:
Colors
.
transparent
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
CircleAvatar
(
backgroundColor:
greenPrimary
,
child:
Text
(
'Test'
),
),
Padding
(
padding:
EdgeInsets
.
all
(
doubleSpace
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
'Margo City'
,
style:
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
w800
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
),
),
Text
(
'Jl. Margonda Raya No.358, Kemir...'
,
style:
TextStyle
(
fontSize:
15
,
color:
Colors
.
black
,
fontFamily:
'Muli'
,
),
),
],
),
),
Icon
(
Icons
.
arrow_forward_ios
,
color:
Colors
.
grey
[
400
],
size:
20
,
)
],
),
),
Container
(
decoration:
BoxDecoration
(
border:
Border
(
top:
BorderSide
(
color:
Colors
.
grey
[
400
]))),
),
],
);
}
);
})
]));
}
}
\ No newline at end of file
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