/Flutter Dismissable
//Go to main.dart folder
//All code Cut
// paste this Code ⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
import 'package:flutter/material.dart';
void main() {
runApp(Dismissable());
}
class Dismissable extends StatefulWidget {
const Dismissable({Key? key}) : super(key: key);
@override
State<Dismissable> createState() => _DismissableState();
}
class _DismissableState extends State<Dismissable> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Dismissible(
key: ValueKey('abcd'),
secondaryBackground: Container(
color: Colors.green,
child: Icon(
Icons.tv,
size: 30,
),
),
background: Container(
color: Colors.red,
child: Icon(
Icons.tv_off,
size: 30,
),
),
// key:,
child: ListTile(
title: Text('Hi'),
subtitle: Text('Flutter'),
trailing: Icon(Icons.tv),
),
),
),
);
}
}
// OutPut
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////// Flutter Fun ///////////////// from dhirgo///////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////