GitHub 儲存庫dridino/smooth_list_view

smooth_list_view

Flutter 中 ListView 的流暢實作。

smooth_list_view 專案封面
星標
4
分支
1
最近推送(UTC)
2024年12月22日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

A flutter plugin to implement smooth scrolling on desktop and web.

Comparison

Without
without the package
With
with the package

Features

  • Like the standard ListView but better
  • Scroll smoothly no matter what platform you're using (web, desktop, mobile)
  • Support scroll switching between mouse and trackpad

Constructors

  • SmoothListView(...) : behave exactly like a classic ListView(...) except that it makes scrolling with a mouse wheel smoother.
  • SmoothListView.builder(...) : behave exactly like a classic ListView.builder(...) except that it makes scrolling with a mouse wheel smoother.
  • SmoothListView.adapative(...) : behave exactly like a classic ListView(...) except that it allows you to easily switch between smooth scroll and classic scroll.
  • SmoothListView.adaptiveBuilder(...) : behave exactly like a classic ListView.builder(...) except that it allows you to easily switch between smooth scroll and classic scroll.

Getting started

First, add the package to your pubspec.yaml :

flutter pub add smooth_list_view

Then import it inside your Dart code :

import 'package:smooth_list_view/smooth_list_view.dart';

Usage

Import the package :

import 'package:smooth_list_view/smooth_list_view.dart';
ListView

Replace :

// ...
@override
Widget build(BuildContext context) {
    return ListView(...);
}
// ...

With :

// ...
@override
Widget build(BuildContext context) {
    // You can keep the exact same parameters
    return SmoothListView(...);
}
// ...
ListView.builder()

Replace :

// ...
@override
Widget build(BuildContext context) {
    return ListView.builder(...);
}
// ...

With :

// ...
@override
Widget build(BuildContext context) {
    // You can keep the exact same parameters
    return SmoothListView.builder(...);
}
// ...
ListView.separated()

Replace :

// ...
@override
Widget build(BuildContext context) {
    return ListView.separated(...);
}
// ...

With :

// ...
@override
Widget build(BuildContext context) {
    // You can keep the exact same parameters
    return SmoothListView.separated(...);
}
// ...
ListView.custom()

Replace :

// ...
@override
Widget build(BuildContext context) {
    return ListView.custom(...);
}
// ...

With :

// ...
@override
Widget build(BuildContext context) {
    // You can keep the exact same parameters
    return SmoothListView.custom(...);
}
// ...

Additional information

Feel free to check the Example panel for a richer implementation.

If you encounter any issue feel free to open one on GitHub :)

dridino GitHub avatar
GitHub 作者

dridino ↗

語言DartC++CMakeHTMLSwiftCKotlinObjective-C

分類

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項

  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^5.0.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗