0

flutter_secure_storage パッケージを使用しており、リスト内のアイテムを並べ替えようとしています。リストは次のようになります。List<_SecItems> hi = []

によって定義されます。

class _SecItem {
  _SecItem(this.key, this.value);

  final String key;
  final String value;
}

リスト内の項目の順序は保持されません。そして使用hi.sort()するとメッセージが表示されますtype '_SecItem' is not a subtype of type 'Comparable<dynamic>'

では、_Secitem 要素のリスト内の文字列をどのように並べ替えるのでしょうか? List<_Secitems> 内の要素は文字列のままです。

4

2 に答える 2