GitHub repositorydridino/smooth_list_view

smooth_list_view

A smooth implementation of ListViews in Flutter.

smooth_list_view project cover
Stars
4
Forks
1
Last push (UTC)
Dec 22, 2024
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

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 author

dridino ↗

LanguagesDartC++CMakeHTMLSwiftCKotlinObjective-C

Categories

Packages published by this repository

Dependencies used

Dependency list 3 items

  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}
  • flutter_lintsDevelopment^5.0.0

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

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

GitHub Docs — About repositories ↗