Skip to content

Instantly share code, notes, and snippets.

@becek2n
Created May 9, 2020 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save becek2n/65369ca4edaec93e17402bc87cbb2b41 to your computer and use it in GitHub Desktop.
Save becek2n/65369ca4edaec93e17402bc87cbb2b41 to your computer and use it in GitHub Desktop.
Column(
children: [
Padding(
padding: EdgeInsets.all(5),
child: Padding(
padding: EdgeInsets.only(top: 20, left: 20, bottom: 20),
child: Row(
children: [
Icon(Icons.view_list, color: Colors.grey),
Padding(
padding: EdgeInsets.only(left: 10),
child: Text("Laporan Data Karyawan", style: TextStyle(fontSize: 20),),
)
],
),
)
),
Padding(
padding: EdgeInsets.only(left:50, right: 10),
child: Divider(thickness: 2,),
),
Padding(
padding: EdgeInsets.only(left:100, right: 10, bottom: 10),
child: Divider(thickness: 2,),
),
Card(
elevation: 3.0,
child: Padding(
padding: EdgeInsets.only(top: 15, bottom: 15),
child: ListView.builder(
itemCount: modelList.length,
shrinkWrap: true,
itemBuilder: (context, index){
return Slidable(
actionPane: SlidableDrawerActionPane(),
actionExtentRatio: 0.25,
child: ListTile(
leading: Container(
width: 40,
height: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: Colors.redAccent
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(modelList[index].id.toString()),
],
)
),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(modelList[index].nama),
Padding(
padding: EdgeInsets.only(top: 5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.phone, size: 13, color: Colors.green,),
Text(" " + modelList[index].telp, style: TextStyle(fontSize: 12, color: Colors.grey),),
Container(
height: 20,
child: VerticalDivider(color: Colors.red, thickness: 1,),
),
Icon(Icons.email, size: 13, color: Colors.orangeAccent,),
Text(" " + modelList[index].email, style: TextStyle(fontSize: 12, color: Colors.grey),),
],
)
),
(index == modelList.length -1) ? Container() : Divider(thickness: 2,)
],
)
),
secondaryActions: [
IconSlideAction(
caption: 'Ubah',
color: Colors.green,
icon: Icons.edit,
onTap: () {},
),
IconSlideAction(
caption: 'Hapus',
color: Colors.red,
icon: Icons.delete,
onTap: () => {
_deleteKaryawan(modelList[index].id)
},
),
],
);
},
),
)
)
],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment