alphanum_comparator 2.0.2 copy "alphanum_comparator: ^2.0.2" to clipboard
alphanum_comparator: ^2.0.2 copied to clipboard

Porting of "The Alphanum Algorithm" in Dart, used to sort string lists alphanumerically.

example/lib/main.dart

import 'package:alphanum_comparator/alphanum_comparator.dart';
import 'package:flutter/material.dart';

void main() {
  final List<String> _unsorted = ["Item 2", "Item 3", "Item 10", "Item 1"];
  final List<String> _sorted = _unsorted;
  _sorted.sort(AlphanumComparator.compare);

  runApp(MaterialApp(
    home: Scaffold(
        body: ListView(
      children: <Widget>[
        ListTile(title: Text('Unsorted Strings')),
        ..._unsorted.map((i) => ListTile(title: Text('$i'))).toList(),
        ListTile(title: Text('Sorted Strings')),
        ..._sorted.map((i) => ListTile(title: Text('$i'))).toList(),
      ],
    )),
  ));
}
10
likes
150
points
243
downloads

Publisher

verified publisherquantos.it

Weekly Downloads

Porting of "The Alphanum Algorithm" in Dart, used to sort string lists alphanumerically.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

More

Packages that depend on alphanum_comparator