ListView Animation In Flutter

ListView Animation In Flutter :

ListView Animation In Flutter
class SeePhone
{
  int id;
  String name;

  SeePhone({this.id, this.name});
}


import 'package:flutter/material.dart';

class HomePage extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<HomePage> with TickerProviderStateMixin {
  AnimationController controller;
  Animation animation;

  initState() {
    super.initState();
    controller = AnimationController(
        duration: const Duration(milliseconds: 1000), vsync: this);
    animation = CurvedAnimation(parent: controller, curve: Curves.easeIn);

    animation.addStatusListener((status) {});
    controller.forward();
  }

  @override
  Widget build(BuildContext context) {
    List<SeePhone> seePhoneList = seePhoneData();

    return Scaffold(
        body: ListView.builder(
            itemCount: seePhoneList.length,
            physics: ClampingScrollPhysics(),
            itemBuilder: (context, position) {
              SeePhone seePhone = seePhoneList[position];

              return new SizeTransition(
                  sizeFactor: animation,
                  child: Center(
                    child: Card(
                      child: Container(
                        width: 150,
                        height: 150,
                        child: Center(child: Text(seePhone.name)),
                      ),
                    ),
                  ));
            }));
  }

  List<SeePhone> seePhoneData() {
    List<SeePhone> seePhone = new List<SeePhone>();
    seePhone.add(new SeePhone(id: 1, name: 'Phone Images'));
    seePhone.add(new SeePhone(id: 2, name: 'Warranty'));

    return seePhone;
  }
}

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit www.fluttertutorial.in