yx_icon_fonts_flutter/example/lib/example_icon.dart

25 lines
661 B
Dart

import 'package:flutter/widgets.dart';
/// 示例图标类
///
/// 用于在示例应用中展示图标
class ExampleIcon implements Comparable {
final IconData iconData;
final String title;
ExampleIcon(this.iconData, this.title);
@override
String toString() => 'ExampleIcon{iconData: $iconData, title: $title}';
@override
bool operator ==(Object other) =>
identical(this, other) || other is ExampleIcon && runtimeType == other.runtimeType && iconData == other.iconData && title == other.title;
@override
int get hashCode => iconData.hashCode ^ title.hashCode;
@override
int compareTo(other) => title.compareTo(other.title);
}