패키지, 저장소 및 앱 카테고리 검색

smooth_sort 표지
패키지 상세v2.0.1

smooth_sort

아름답고 사용자 정의 가능한 정렬 애니메이션을 추가하기 위한 플러터 패키지입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
106
좋아요
32
Pub 점수
160

패키지 설치

flutter pub add smooth_sort

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Smooth Sort는 리스트에 부드럽고 사용자 정의 가능한 정렬 애니메이션을 가능하게 하는 Flutter 패키지입니다. 리스트 항목이 재정렬될 때 유연한 시각적 전환을 제공하여 사용자 경험을 향상시킵니다. 세련된 UI 상호작용을 원하는 개발자를 위해 설계되었으며, 다양한 애니메이션 유형을 지원하고 Android, iOS, Web, macOS, Windows, Linux 대상 앱에 쉽게 통합할 수 있습니다. 성능과 간결함에 초점을 맞추어 복잡한 구현 없이도 동적인 정렬 효과를 추가할 수 있도록 합니다. 대시보드, 작업 목록 및 리스트 재정렬이 자주 발생하는 모든 앱에 적합합니다.

사용 사례

  • 애니메이션 리스트 재정렬
  • 작업 관리 앱
  • 다시보드 위젯
  • 정렬 가능한 데이터 테이블
  • 사용자 기반 리스트 정렬
  • 인터랙티브 UI 컴포넌트

주요 기능

  • 사용자 정의 가능한 정렬 애니메이션
  • 크로스 플랫폼 지원
  • ListView와의 간편한 통합
  • 성능 최적화 렌더링
  • 사용자 정의 가능한 애니메이션 곡선
  • 드래그 앤 드롭 시나리오를 지원합니다

적합한 대상

  • 애니메이션 리스트 상호작용을 원하는 개발자
  • 자주 업데이트되는 목록을 가진 앱
  • 사용자 인터페이스 중심 애플리케이션
  • 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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.