-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathicon_pack.dart
71 lines (58 loc) · 1.76 KB
/
icon_pack.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import 'package:collection/collection.dart';
/// The IconPack defines which Icons are gonna be loaded
enum IconPack {
/// The official Material Icons by Flutter (without rounded, outlined or sharp icons)
material(
path: 'MaterialDefault',
description: 'Material Icons by Flutter',
),
/// The official Material Icons by Flutter (including rounded, outlined or sharp icons)
allMaterial(
path: 'Material',
description:
'All Material Icons (including rounded, outlined or sharp icons)',
),
/// The official Material Sharp Icons by Flutter
sharpMaterial(
path: 'MaterialSharp',
description: 'Material Sharp Icons',
),
/// The official Material Rounded Icons by Flutter
roundedMaterial(
path: 'MaterialRounded',
description: 'Material Rounded Icons',
),
/// The official Material Outlined Icons by Flutter
outlinedMaterial(
path: 'MaterialOutlined',
description: 'Material Outlined Icons',
),
/// The official Cupertino Icons (Apple Design)
cupertino(
path: 'Cupertino',
description: 'Cupertino Icons (Apple Design)',
),
/// The official font_awesome_flutter Icons by the Flutter Community (Brian Egan)
fontAwesomeIcons(
path: 'FontAwesome',
description: 'Font Awesome Icons',
),
/// The official line_awesome_icons Icons by Phuc Chau
lineAwesomeIcons(
path: 'LineIcons',
description: 'Line Awesome Icons',
),
/// Use this to show your own custom provided IconPack
custom;
const IconPack({
this.path,
this.description,
});
final String? path;
final String? description;
/// Get the IconPack by its name
static IconPack? byName(String? pack) {
if (pack == null) return null;
return IconPack.values.firstWhereOrNull((p) => p.name == pack);
}
}