class _EmployeesListScreenState extends State<EmployeesListScreen> {
var db = new DatabaseHelper(); // CALLS FUTURE
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('List Of Employees'),
),
body: FutureBuilder<List>(
future: db.getAllRecords("tabEmployee"),
initialData: const [],
builder: (context, snapshot) {
return snapshot.hasData ? ListView.builder(
itemCount: snapshot.data?.length,
itemBuilder: (_, int position) {
final item = snapshot.data?.elementAt(position);
//get your item data here ...
return Card(child: ListTile(
title: Text('Employee Name: ${item?.row[1]}'),
),
);
},
);
},
),
);
}
}