-
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.
Add config option to reorder views in emoji picker (#215)
- Loading branch information
1 parent
5d66346
commit 7d21c79
Showing
8 changed files
with
93 additions
and
24 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
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 @@ | ||
/// View order config | ||
class ViewOrderConfig { | ||
/// Constructor | ||
const ViewOrderConfig({ | ||
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 ViewOrderConfig) && | ||
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, | ||
} |