Answers for "swap and show delete button in flutter"

0

swap and show delete button in flutter

class DrageSCreen extends StatefulWidget {
  @override
  _DrageSCreenState createState() => _DrageSCreenState();
}

class _DrageSCreenState extends State<DrageSCreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text("Drag Bar"),
      ),
      body: Container(
        height: 80,
        child: ListView(
          scrollDirection: Axis.horizontal,
          children: [
            mycard(),
            deleteBtn(),
          ],
        ),
      ),

    );
  }
  Widget mycard(){
    return Container(
      width: MediaQuery.of(context).size.width,
      child: Card(
        color: Colors.blue,
        child: ListTile(
          title: Text("Abc"),
          leading: Icon(Icons.person, color: Colors.white, size: 30,),

        ),
      ),
    );
  }
}
Widget deleteBtn(){
  return Container(
    color: Colors.red,
    width: 100,
    child: Column(
      children: [
        Icon(Icons.delete, color: Colors.white, size: 30,),
        Text("Delte")
      ],
    ),
  );
}
Posted by: Guest on April-06-2021

Code answers related to "swap and show delete button in flutter"

Browse Popular Code Answers by Language