Advertisement
Guest User

AnimatedList remove

a guest
Sep 14th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.22 KB | None | 0 0
  1. IconButton(
  2.                                               icon: Icon(Icons.clear),
  3.                                               onPressed: () {
  4.  
  5.                                                 print("\n\ndel" + index.toString() + "\n\n");
  6.  
  7.  
  8.                                                
  9.  
  10.                                                 AnimatedList.of(context).removeItem(index, (context, animation){
  11.  
  12.                                                   return SizeTransition(
  13.                                                     sizeFactor: animation.drive(Tween(begin: 0, end: 1)),
  14.                                                     axis: Axis.vertical,
  15.                                                     child: FadeTransition(
  16.                                                       opacity: animation.drive(Tween(begin: 0, end: 1)),
  17.                                                       child: Padding(
  18.                                                         padding: const EdgeInsets.symmetric(vertical: 10.0),
  19.                                                         child: Row(
  20.                                                           children: <Widget>[
  21.                                                             Flexible(
  22.                                                               fit: FlexFit.loose,
  23.                                                               child: TextFormField(
  24.  
  25.                                                                 decoration: InputDecoration(
  26.                                                                   fillColor: Colors.grey[300],
  27.                                                                   filled: true,
  28.                                                                   contentPadding: EdgeInsets.symmetric(horizontal: 30, vertical: 20),
  29.                                                                   border: OutlineInputBorder(borderRadius: BorderRadius.circular(100)),
  30.                                                                   disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.amber)),
  31.                                                                   hintText: "Pietanza",
  32.                                                                 ),
  33.                                                               ),
  34.                                                             ),
  35.  
  36.                                                             IconButton(
  37.                                                               icon: Icon(Icons.clear),
  38.                                                               onPressed: (){
  39.  
  40.                                                               },
  41.                                                             )
  42.  
  43.                                                           ],
  44.                                                         ),
  45.                                                       ),
  46.                                                     ),
  47.                                                   );
  48.                                                 });
  49.  
  50.                                                 menu.details.removeAt(index);
  51.  
  52.                                               },
  53.                                             )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement