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 ↗