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

outdated

Porting of "The Alphanum Algorithm" in Dart, used to sort string lists alphanumerically. The complete description of the algorithm can be found here https://github.com/quantosapplications/dart_alphanu [...]

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
0
points
1.31k
downloads

Publisher

verified publisherquantos.it

Weekly Downloads

Porting of "The Alphanum Algorithm" in Dart, used to sort string lists alphanumerically. The complete description of the algorithm can be found here https://github.com/quantosapplications/dart_alphanum_comparator

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on alphanum_comparator