パッケージ、リポジトリ、アプリカテゴリを検索

smooth_sort のカバー
パッケージ詳細v2.0.1

smooth_sort

素晴らしいカスタムソートアニメーションを追加するためのFlutterパッケージ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
106
いいね数
32
Pub ポイント
160

パッケージをインストール

flutter pub add smooth_sort

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Smooth Sort は、リストのスムーズでカスタマイズ可能なソートアニメーションを可能にするFlutterパッケージです。リスト内のアイテムが再順序付けされる際の滑らかな視覚的遷移を提供することで、ユーザー体験を向上させます。洗練されたUIインタラクションを求める開発者向けに設計されており、さまざまなアニメーションタイプをサポートし、Android、iOS、Web、macOS、Windows、Linux対応アプリに簡単に統合できます。パッケージはパフォーマンスとシンプルさに焦点を当てており、複雑な実装なしにダイナミックなソート効果を追加できるようにしています。ダッシュボード、タスクリスト、およびリストの再順序付けが頻繁に行われるすべてのアプリに最適です。

用途

  • アニメーション付きリストの再順序付け
  • タスク管理アプリ
  • ダッシュボードウィジェット
  • 並べ替え可能なデータテーブル
  • ユーザー主導のリストソート
  • インタラクティブUIコンポーネント

主な機能

  • カスタマイズ可能なソートアニメーション
  • クロスプラットフォーム対応
  • ListView との簡単な統合
  • パフォーマンス最適化レンダリング
  • カスタマイズ可能なアニメーション曲線
  • ドラッグアンドドロップのシナリオをサポート

適している対象

  • アニメーション付きリスト操作を希望する開発者
  • 頻繁に更新されるリストを持つアプリ
  • UI中心のアプリケーション
  • Flutter 初心者がアニメーションを探索しています
  • スムーズな遷移を必要とするプロジェクト

注意事項

  • 非常に大きなリストではパフォーマンスに影響する可能性があります
  • 状態管理の適切な取り扱いが必要です
  • リストアイテムの再順序付けに限定
  • 非インタラクティブな並べ替えには適していません
  • アニメーションの複雑さは応答性に影響する可能性があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。


In today's world, developer's use now and then sorting in their mobile applications. For such developer's, Smooth Sort can become a useful package which provides wonderful and custom animation while sorting a list instead of reloading the app.

Explore how to use SmoothSort in your Flutter app through this medium blog.

Table of Contents

Installing

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  smooth_sort: ^2.0.1
2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:smooth_sort/smooth_sort.dart';

Demo

Flip Vertically
animationType: flipVertically

Fade
animationType: fade

Slide Right
animationType: slideRight

Flip Horizontally
animationType: flipHorizontally

Scale
animationType: scale

Slide Left
animationType: slideLeft

Reverse Flip Vertically
animationType: reverseFlipVertically

Reverse Flip Horizontally
animationType: reverseFlipHorizontally

Example in Medium blog

In the medium blog as well as the example app, I have implemented this animation for the shopping app for sorting the products through price using the Smooth Sort package.

Scale Animation

Usage

For adding the SmoothSort in your Flutter app, you have to simply provide the options for ListView or GridView with the list of the widgets to be displayed in the list/grid with the another list of their corresponding itemIds.

For example: First create the object for SmoothSort

SmoothSort smoothSort = SmoothSort(
	listType: 'list',	 // specify the listType i.e. list or grid
	ascendant: true,	// sort ascending or descending
	itemList: [  
	  Container(  
	    color: Colors.red,  
	    alignment: Alignment.center,  
		child: Text(  
		    "A",  
	        style: TextStyle(fontSize: 150.0),  
		    ),  
	  ),  
	  Container(  
	    color: Colors.blueAccent,  
	    alignment: Alignment.center,  
	    child: Text(  
		    "B",  
	        style: TextStyle(fontSize: 150.0),  
			),  
	  ),  
	  Container(  
	    color: Colors.yellowAccent,  
	    alignment: Alignment.center,  
	    child: Text(  
		    "C",  
	        style: TextStyle(fontSize: 150.0),  
			),  
	  ),   
	],					// specify the list of widgets for the ListView/GridView
	itemIdList: [1, 2, 0],		// specify the corresponding ids for widgets	
	animationType: 'cardScale'	// specify the type of animation you want
);

Whenever you want to add the list or grid, just add the above widget as follows:

Column(  
  children: <Widget>[  
    smoothSort	// just add the SmoothSort object
  ],
),

After this, just call the smoothSort.onPress() method to start the animation for sorting the list/grid just like this:

RaisedButton(  
  child: Text("Sort"),  
  onPressed: () {  
    smoothSort.onPress();	// just call the onPress method
  },  
)

For more info, please refer to the main.dart in example.

Documentation

SmoothSort Class
Dart attribute Datatype Description Default Value
listType String Specifies the type of list i.e. list/grid. list
animationType String Specifies the type of animation required to sort the list/grid. flipVertically
itemList List<Widget> The list of widgets which is to be sorted. @required
itemIdList List<int> This list contains the ids for the corresponding widgets needed for the sorting of widgets. @required
gridCrossAxisCount int The number of grids in a single row in GridView. 2
ascendant bool Sort ascending or descending true

For help on editing package code, view the flutter documentation.

Algorithm

The algorithm used to build this project is as follows:

I have sorted the ListView or GridView with single TextView by using the default sort function by Dart language. On clicking of the sort button, I have provided different animations to the ListView or GridView according to the animation described by the user.

For more info, please refer to the smooth_sort.dart.

Bugs or Requests

If you encounter any problems feel free to open an issue. If you feel the library is
missing a feature, please raise a ticket on Github and I'll look into it.
Pull request are also welcome.

Contributors

Thanks goes to these awesome people! :blush:


Giulliano Albrecht

Michael Dudek

License

SmoothSort is licensed under MIT license. View license.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。