{"id":32303664,"url":"https://github.com/deependra227/multi-sort","last_synced_at":"2026-02-22T18:03:15.224Z","repository":{"id":41405954,"uuid":"282903882","full_name":"deependra227/multi-sort","owner":"deependra227","description":"Fast and powerful Flutter package that helps you to sort a list of objects by one or more properties at the same time.","archived":false,"fork":false,"pushed_at":"2021-03-27T21:13:47.000Z","size":82,"stargazers_count":6,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-20T22:34:44.365Z","etag":null,"topics":["dart","flutter","package","pubdev","sort"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/multi_sort","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deependra227.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-27T13:18:54.000Z","updated_at":"2023-05-30T08:23:21.000Z","dependencies_parsed_at":"2022-09-13T08:42:02.870Z","dependency_job_id":null,"html_url":"https://github.com/deependra227/multi-sort","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"purl":"pkg:github/deependra227/multi-sort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deependra227%2Fmulti-sort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deependra227%2Fmulti-sort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deependra227%2Fmulti-sort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deependra227%2Fmulti-sort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deependra227","download_url":"https://codeload.github.com/deependra227/multi-sort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deependra227%2Fmulti-sort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29721056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","package","pubdev","sort"],"created_at":"2025-10-23T06:04:50.625Z","updated_at":"2026-02-22T18:03:15.214Z","avatar_url":"https://github.com/deependra227.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# multi_sort [![Pub Package](https://img.shields.io/pub/v/multi_sort)](https://pub.dev/packages/multi_sort)\n\nA fast and powerful Flutter package helps you sort a list of objects by one or more properties at the same time.\n\n## Why?\nSuppose you have a list of Phones and you want to sort it according to there specification like RAM, Storage, Price, Camera, etc. at the same time similar to Microsoft Excel sorting.\u003cbr\u003e\u003cbr\u003e\nSuppose I have a list of phones as following.\n```\nList\u003cPhone\u003e items = [\n    Phone(\"real me 6\", 6, 18999, 128),\n    Phone(\"real me 6\", 8, 19999, 128),\n    Phone(\"real Note 8\", 7, 16999, 128),\n    Phone(\"oppo a9\", 4, 13999, 128),\n    Phone(\"real me 6 pro\", 6, 17999, 64),\n    Phone(\"Oppo 5as\", 2, 8999, 32),\n    Phone(\"Real me 5i\", 4, 10999, 64),\n    Phone(\"Poco x2\", 6, 18500, 128),\n  ]\n```\nAfter sorting in the preference order of first by RAM and then by Storage you will get\n```\n[\n    Phone(\"real me 6\", 8, 19999, 128),\n    Phone(\"real Note 8\", 7, 16999, 128),\n    Phone(\"real me 6\", 6, 18999, 128),\n    Phone(\"Poco x2\", 6, 18500, 128),\n    Phone(\"real me 6 pro\", 6, 17999, 64),\n    Phone(\"oppo a9\", 4, 13999, 128),\n    Phone(\"Oppo 5as\", 2, 8999, 32),\n    Phone(\"Real me 5i\", 4, 10999, 64),\n ]\n```\nUsing this Flutter Package, you can do this Preference Sort/Multiple Sorts/ Multiple level Sorts at the same time very easily.\n\n# Installing\n### 1. Depend on it\n\nAdd this to your package's pubspec.yaml file:\n\n```yaml\ndependencies:\n  multi_sort: ^3.0.0\n```\n\n### 2. Install it\nYou can install packages from the command line:\n\nwith Flutter:\n\n```shell\n$ flutter pub get\n```\nAlternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.\n\n### 3. Import it\nNow in your Dart code, you can use:\n\n```dart\nimport 'package:multi_sort/multi_sort.dart';\n```\n# Documentation\n*  ```dynamic preferrence``` List of properties in which you want to sort the list i.e. ```List\u003cproperty\u003e preferrence = ['property1','property2']``` first sort the list by property1 then by property2.\n*  ```List\u003cbool\u003e criteria``` List of booleans that specifies the criteria of sort i.e., For ascending order ```true``` and for descending order ```false```.\n\n# Usage\nInitialization\n```\nList\u003cproperty\u003e list; // List of Items\nList\u003cbool\u003e criteria ; //Criteria List\nList\u003cString\u003e preferrence ; //prefrrence List\n```\nNow sort the list using multisort\n``` \nlist.multisort(criteria, preferrence);\n```\n\n\n# Example\n```\nimport 'package:flutter/material.dart';\nimport \"package:multi_sort/multi_sort.dart\";\n\nvoid main() {\n  runApp(MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: 'Flutter Demo',\n      theme: ThemeData(\n        primarySwatch: Colors.blue,\n        visualDensity: VisualDensity.adaptivePlatformDensity,\n      ),\n      home: ExampleApp(),\n    );\n  }\n}\n\nclass ExampleApp extends StatefulWidget {\n  ExampleApp({Key key}) : super(key: key);\n\n  @override\n  _ExampleAppState createState() =\u003e _ExampleAppState();\n}\n\n/// Class of Items\nclass Items {\n  String name;\n  int ram;\n  int price;\n  int storage;\n  Items(this.name, this.ram, this.price, this.storage);\n\n  ///Mapping the properties\n  Map\u003cString, dynamic\u003e _toMap() {\n    return {'name': name, 'price': price, 'ram': ram, 'storage': storage};\n  }\n\n  ///get function to get the properties of Item\n  dynamic get(String propertyName) {\n    var _mapRep = _toMap();\n    if (_mapRep.containsKey(propertyName)) {\n      return _mapRep[propertyName];\n    }\n    throw ArgumentError('propery not found');\n  }\n}\n\nclass _ExampleAppState extends State\u003cExampleApp\u003e {\n  //List of Items\n  List\u003cItems\u003e items = [\n    Items(\"real me 6\", 6, 18999, 128),\n    Items(\"real me 6\", 8, 19999, 128),\n    Items(\"real Note 8\", 7, 16999, 128),\n    Items(\"oppo a9\", 4, 13999, 128),\n    Items(\"real me 6 pro\", 6, 17999, 64),\n    Items(\"Oppo 5as\", 2, 8999, 32),\n    Items(\"Real me 5i\", 4, 10999, 64),\n    Items(\"Poco x2\", 6, 18500, 128),\n  ];\n  // Temp List for sorting\n  List\u003cItems\u003e sortingList = [];\n  //Criteria List\n  List\u003cbool\u003e criteria = [false, false];\n  //prefrrence List\n  List\u003cString\u003e preferrence = ['ram', 'storage'];\n\n  @override\n  void initState() {\n    // TODO: implement initState\n    super.initState();\n    setState(() {\n      sortingList = items;\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text(\"Sort List Example\"),\n      ),\n      body: Column(\n        children: [\n          _buttons(),\n          ListView.builder(\n              shrinkWrap: true,\n              itemCount: sortingList.length,\n              itemBuilder: (BuildContext context, int i) {\n                return Card(\n                  child: Row(\n                    mainAxisAlignment: MainAxisAlignment.spaceBetween,\n                    children: [\n                      Text(sortingList[i].name),\n                      Text(sortingList[i].price.toString()),\n                      Text(sortingList[i].ram.toString()),\n                      Text(sortingList[i].storage.toString()),\n                    ],\n                  ),\n                );\n              }),\n        ],\n      ),\n    );\n  }\n\n  Widget _buttons() {\n    return RaisedButton(\n      onPressed: () {\n        setState(() {\n          ///Sorting using MultiSort\n          sortingList.multisort(criteria, preferrence);\n        });\n      },\n      child: Text('Sort by preferrence'),\n    );\n  }\n}\n\n```\n# License\n\nmulti_sort is licensed under `MIT license`.\n```\nMIT License\n\nCopyright (c) 2020 Deependra Chansoliya\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeependra227%2Fmulti-sort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeependra227%2Fmulti-sort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeependra227%2Fmulti-sort/lists"}