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 { ...@@ -11,6 +11,9 @@ class UserControl extends StatefulWidget {
} }
class _UserControlState extends State<UserControl> { class _UserControlState extends State<UserControl> {
String _searchResult = '';
TextEditingController searchController = TextEditingController();
void apiService(BuildContext context) { void apiService(BuildContext context) {
FutureBuilder<List<dynamic>>( FutureBuilder<List<dynamic>>(
future: getUserControl(), future: getUserControl(),
...@@ -64,6 +67,21 @@ class _UserControlState extends State<UserControl> { ...@@ -64,6 +67,21 @@ class _UserControlState extends State<UserControl> {
child: ListView( child: ListView(
controller: ScrollController(), controller: ScrollController(),
children: [ 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>>( FutureBuilder<List<dynamic>>(
future: getUserControl(), future: getUserControl(),
builder: (BuildContext context, AsyncSnapshot snapshot) { builder: (BuildContext context, AsyncSnapshot snapshot) {
...@@ -111,8 +129,6 @@ class _UserControlState extends State<UserControl> { ...@@ -111,8 +129,6 @@ class _UserControlState extends State<UserControl> {
rows: List.generate(snapshot.data.length, (index) { rows: List.generate(snapshot.data.length, (index) {
var pgm = snapshot.data[index]; var pgm = snapshot.data[index];
bool _isEditingText = false;
final nameRSController = TextEditingController() final nameRSController = TextEditingController()
..text = pgm['namaRs'].toString(); ..text = pgm['namaRs'].toString();
final phoneRSController = TextEditingController( 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