Commit 1ecf54e9 authored by Tohap Maruli Pasaribu's avatar Tohap Maruli Pasaribu

add search button

parent 07033f1f
......@@ -11,6 +11,9 @@ class UserControl extends StatefulWidget {
}
class _UserControlState extends State<UserControl> {
String _searchResult = '';
TextEditingController searchController = TextEditingController();
void apiService(BuildContext context) {
FutureBuilder<List<dynamic>>(
future: getUserControl(),
......@@ -64,6 +67,21 @@ class _UserControlState extends State<UserControl> {
child: ListView(
controller: ScrollController(),
children: [
Card(
child: new ListTile(
leading: new Icon(Icons.search),
title: new TextField(
controller: searchController,
decoration: new InputDecoration(
hintText: 'Search', border: InputBorder.none),
onChanged: (value) {
setState(() {
_searchResult = value;
});
},
),
),
),
FutureBuilder<List<dynamic>>(
future: getUserControl(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
......@@ -111,8 +129,6 @@ class _UserControlState extends State<UserControl> {
rows: List.generate(snapshot.data.length, (index) {
var pgm = snapshot.data[index];
bool _isEditingText = false;
final nameRSController = TextEditingController()
..text = pgm['namaRs'].toString();
final phoneRSController = TextEditingController(
......
Markdown is supported
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