mirror of
https://github.com/flutter/samples.git
synced 2026-03-27 14:51:45 +00:00
This PR adds a Flutter sample app that shows an implementation of the "infinite list" UX pattern. That is, a list is shown to the user as if it was continuous although it is internally paginated. This is a common feature of mobile apps, from shopping catalogs through search engines to social media clients.
25 lines
495 B
Dart
25 lines
495 B
Dart
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:meta/meta.dart';
|
|
|
|
import 'item.dart';
|
|
|
|
const int itemsPerPage = 20;
|
|
|
|
class ItemPage {
|
|
final List<Item> items;
|
|
|
|
final int startingIndex;
|
|
|
|
final bool hasNext;
|
|
|
|
ItemPage({
|
|
@required this.items,
|
|
@required this.startingIndex,
|
|
@required this.hasNext,
|
|
});
|
|
}
|