-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add config option to reorder items in emoji picker
- Loading branch information
1 parent
0978a59
commit c568b84
Showing
7 changed files
with
87 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/// Items order config | ||
class ItemsOrderConfig { | ||
/// Constructor | ||
const ItemsOrderConfig({ | ||
required this.top, | ||
required this.middle, | ||
required this.bottom, | ||
}) : assert(!identical(top, middle) && | ||
!identical(top, bottom) && | ||
!identical(middle, bottom)); | ||
|
||
/// First item | ||
final EmojiPickerItem top; | ||
|
||
/// Middle item | ||
final EmojiPickerItem middle; | ||
|
||
/// Last item | ||
final EmojiPickerItem bottom; | ||
|
||
@override | ||
bool operator ==(other) { | ||
return (other is ItemsOrderConfig) && | ||
other.top == top && | ||
other.middle == middle && | ||
other.bottom == bottom; | ||
} | ||
|
||
@override | ||
int get hashCode => top.hashCode ^ middle.hashCode ^ bottom.hashCode; | ||
} | ||
|
||
/// Widgets shown in `EmojiPicker` view | ||
enum EmojiPickerItem { | ||
/// The tab bar to choose between different emoji categories | ||
categoryBar, | ||
|
||
/// The area that shows emojis | ||
emojiView, | ||
|
||
/// The search bar to search emojis | ||
searchBar, | ||
} |