1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Samples maintenance (#435)

This commit is contained in:
Brett Morgan
2020-05-13 09:18:26 +10:00
committed by GitHub
parent 941ebebfad
commit baa1f976b2
94 changed files with 492 additions and 349 deletions

View File

@@ -8,6 +8,7 @@ import 'package:flutter/widgets.dart';
class AnimatedListDemo extends StatefulWidget {
static String routeName = '/misc/animated_list';
@override
_AnimatedListDemoState createState() => _AnimatedListDemoState();
}
@@ -17,9 +18,9 @@ class _AnimatedListDemoState extends State<AnimatedListDemo> {
void addUser() {
setState(() {
int index = listData.length;
var index = listData.length;
listData.add(
UserModel(firstName: "New", lastName: "Person"),
UserModel(firstName: 'New', lastName: 'Person'),
);
_listKey.currentState
.insertItem(index, duration: Duration(milliseconds: 300));
@@ -96,23 +97,23 @@ class UserModel {
List<UserModel> initialListData = [
UserModel(
firstName: "Govind",
lastName: "Dixit",
firstName: 'Govind',
lastName: 'Dixit',
),
UserModel(
firstName: "Greta",
lastName: "Stoll",
firstName: 'Greta',
lastName: 'Stoll',
),
UserModel(
firstName: "Monty",
lastName: "Carlo",
firstName: 'Monty',
lastName: 'Carlo',
),
UserModel(
firstName: "Petey",
lastName: "Cruiser",
firstName: 'Petey',
lastName: 'Cruiser',
),
UserModel(
firstName: "Barry",
lastName: "Cade",
firstName: 'Barry',
lastName: 'Cade',
),
];