emoji_extension 1.2.0 copy "emoji_extension: ^1.2.0" to clipboard
emoji_extension: ^1.2.0 copied to clipboard

Emojis for Flutter & Dart (Unicode 16.0) + one, yet powerful emojis String extension

1.2.0 #

  • Updated emoji dataset to newest Unicode 16.0
  • Updated dependencies
  • Require Dart ^3.4.0
  • Exported emoji regex:
final regex = Emojis.regex;
  // print(regex); // RegExp: pattern=[#*\d]\uFE0F?\u20E3|[\xA9\...

1.1.1 #

  • Changed *gif demo files to *webp format

1.1.0 #

1.0.0 #

BREAKING CHANGES:

Changed Emojis() class API to static

Generally Emojis() becomes simply Emojis (without brackets at the end):

/*Old*/ Emojis()                   /*New*/ Emojis

/*Old*/ Emojis().smileysAndEmotion /*New*/ Emojis.smileysAndEmotion

/*Old*/ Emojis().groups            /*New*/ Emojis.groups

/*Old*/ Emojis().getOne()          /*New*/ Emojis.getOne()

// etc...

Changed Emojis().get to Emojis.all:

/*Old*/ Emojis().get        /*New*/ Emojis.all

/*Old*/ Emojis().get.values /*New*/ Emojis.all.values

/*Old*/ Emojis().get.names  /*New*/ Emojis.all.names

// etc...

Removed any getter -> use contains instead

Removed replaceEach method -> use replaceWith instead

Removed hasAny method -> use anyOf instead

Removed hasEach method -> use containsOf instead

Removed everyOf method -> use containsOf instead

  • Introduced new Emoji() constructor that takes single emoji as parameter
Emoji('🦊')
           .name // Fox
           .appleName // Fox Face
           .unicode // 1F98A
           .shortcode // :fox:
           .discordShortcode // :fox:
           .discordShortcodes // [:fox:, :fox_face:]
                             .first // :fox:
                             .second // :fox_face:
           .version // Version.v9_0
                   .value // 9.0
           .isAnimal // true
           .isFlag // false
           .isFlower // false
           .isFruit // false
           .isGeometric // false
           .isMan // false
           .isWoman // false
           .isVegetable // false
           .isPerson // false
           .isMultiPerson // false
           .isSymbol // false
           .isV9_0 // true
           .hasBeard // false
           .hasFace // true
           .hasHairStyle // false
           .hasSkinTone // false
           .hasColor // false
           .color // null
           .skinTone // null
           .hairStyle // null
  • Added new methods and getters:

first

'πŸ”΄teπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.first // Emoji(value: πŸ”΄, ...)

firstOrNull

'πŸ”΄teπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.firstOrNull // Emoji(value: πŸ”΄, ...)
'text'.emojis.firstOrNull; // null

second

'πŸ‘οΈteπŸ”΄xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.second // Emoji(value: πŸ”΄, ...)

secondOrNull

'πŸ‘οΈteπŸ”΄xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.secondOrNull // Emoji(value: πŸ”΄, ...)
'text'.emojis.secondOrNull; // null

third

'πŸ‘οΈteπŸ”΄xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.third // Emoji(value: πŸ”΄, ...)

thirdOrNull

'πŸ‘οΈteπŸ”΄xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.thirdOrNull // Emoji(value: πŸ”΄, ...)
'text'.emojis.thirdOrNull; // null

fourth

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ”΄xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.fourth // Emoji(value: πŸ”΄, ...)

fourthOrNull

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ”΄xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.fourthOrNull // Emoji(value: πŸ”΄, ...)
'text'.emojis.fourthOrNull; // null

fifth

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ”΄teπŸ‘πŸΏxt'.emojis.fifth // Emoji(value: πŸ”΄, ...)

fifthOrNull

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ”΄teπŸ‘πŸΏxt'.emojis.fifthOrNull // Emoji(value: πŸ”΄, ...)
'text'.emojis.fifthOrNull; // null

sixth

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ”΄xt'.emojis.sixth // Emoji(value: πŸ”΄, ...)

sixthOrNull

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ”΄xt'.emojis.sixthOrNull // Emoji(value: πŸ”΄, ...)
'text'.emojis.sixthOrNull; // null

penultimate

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ”΄teπŸ‘πŸΏxt'.emojis.penultimate // Emoji(value: πŸ”΄, ...)

penultimateOrNull

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ”΄teπŸ‘πŸΏxt'.emojis.penultimateOrNull // Emoji(value: πŸ”΄, ...)
'text'.emojis.penultimateOrNull; // null

last

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ”΄xt'.emojis.last // Emoji(value: πŸ”΄, ...)

lastOrNull

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ”΄xt'.emojis.lastOrNull // Emoji(value: πŸ”΄, ...)
'text'.emojis.lastOrNull; // null

removeFirst

'πŸ”΄teπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.removeFirst; // teπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt

removeSecond

'πŸ‘οΈteπŸ”΄xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.removeSecond; // πŸ‘οΈtextπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt

removeThird

'πŸ‘οΈteπŸ‘πŸ»xtπŸ”΄teπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.removeThird; // πŸ‘οΈteπŸ‘πŸ»xtteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ‘πŸΏxt

removeFourth

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ”΄xtπŸ‘πŸΎteπŸ‘πŸΏxt'.emojis.removeFourth; // πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌtextπŸ‘πŸΎteπŸ‘πŸΏxt

removeFifth

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ”΄teπŸ‘πŸΏxt'.emojis.removeFifth; // πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtteπŸ‘πŸΏxt

removeSixth

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ”΄xt'.emojis.removeSixth; // πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎtext

removePenultimate

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ”΄teπŸ‘πŸΏxt'.emojis.removePenultimate; // πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtteπŸ‘πŸΏxt

removeLast

'πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎteπŸ”΄xt'.emojis.removeLast; // πŸ‘οΈteπŸ‘πŸ»xtπŸ‘πŸΌteπŸ‘πŸ½xtπŸ‘πŸΎtext

any()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.any((e) => e.value == 'πŸ˜€'); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.any((e) => e.value == 'πŸ‘πŸ»'); // false

containsOf()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsOf(['πŸ˜€']); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsOf(['πŸ˜€', 'πŸ€¦πŸΎβ€β™€οΈ']); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsOf(['πŸ˜€', 'πŸ‘πŸ»']); // false
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsOf(['πŸ‘πŸ»']); // false

containsExactlyOf()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsExactlyOf(['πŸ˜€']); // false
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsExactlyOf(['πŸ˜€', 'πŸ€¦πŸΎβ€β™€οΈ']); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.containsExactlyOf(['πŸ˜€', 'πŸ€¦πŸΎβ€β™€οΈ']); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsExactlyOf(['πŸ‘πŸ»']); // false

containsOne()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.containsOne((e) => e.value == 'πŸ€¦πŸΎβ€β™€οΈ'); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.containsOne((e) => e.value == 'πŸ‘πŸ»'); // false
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.containsOne((e) => e.value == 'πŸ˜€'); // false

containsOneOf()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsOneOf({'πŸ€¦πŸΎβ€β™€οΈ'}); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsOneOf({'πŸ˜€', 'πŸ€¦πŸΎβ€β™€οΈ'}); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsOneOf('πŸ˜€', 'πŸ€¦πŸΎβ€β™€οΈ', 'πŸ‘πŸ»'}); // false
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.containsOneOf({'πŸ˜€'}); // false

containsExactlyOne()

'πŸ˜€text'.emojis.containsExactlyOne((e) => e.value == 'πŸ˜€'); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsExactlyOne((e) => e.value == 'πŸ˜€'); // false
'text'.emojis.containsExactlyOne((e) => e.value == 'πŸ˜€'); // false

containsExactlyOneOf()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsExactlyOneOf({'πŸ˜€', 'πŸ€¦πŸΎβ€β™€οΈ'}); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.containsExactlyOneOf({'πŸ˜€', 'πŸ€¦πŸΎβ€β™€οΈ'}); // false
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsExactlyOneOf({'πŸ˜€'}); // false
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.containsExactlyOneOf({'πŸ˜€', 'πŸ‘πŸ»'}); // false

countWhere()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.countWhere((e) => e.value == 'πŸ˜€'); // 2

countWhereIndexed()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.countWhereIndexed((i, e) => i == 0 && e.value == 'πŸ˜€'); // 1

every()

'πŸ˜€textπŸ˜€'.emojis.every((e) => e.value == 'πŸ˜€'); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.every((e) => e.value == 'πŸ˜€'); // false
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.every((e) => e.value == 'πŸ‘πŸ»'); // false

firstWhere()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.firstWhere((e) => e.name.contains('Woman')); // Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...)

firstWhereIndexed()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.firstWhereIndexed((i, e) => i > 0 && e.name.contains('Woman')); // Emoji(value: πŸ€¦πŸ»β€β™€οΈ, ...)

firstWhereOrNull()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.firstWhereOrNull((e) => e.name.contains('Woman')); // Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...)

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.firstWhereOrNull((e) => e.value == 'πŸ‘πŸ»'); // null

firstWhereIndexedOrNull()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.firstWhereIndexedOrNull((i, e) => i == 0 && e.name.contains('Woman')); // Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...)

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.firstWhereIndexedOrNull((i, e) => i == 0 && e.value == 'πŸ˜€'); // null

fold()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.fold('start', (p, c) => p + c.value); // startπŸ˜€πŸ€¦πŸΎβ€β™€οΈ

foldIndexed()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.foldIndexed('start', (i, p ,c) => '$p${c.value}$i'); // startπŸ˜€0πŸ€¦πŸΎβ€β™€οΈ1

forEach()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.forEach((e) => print(e.value)); // πŸ˜€ πŸ€¦πŸΎβ€β™€οΈ

forEachIndexed()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.forEachIndexed(i,e) => print('$i:${e.value}')); // 0:πŸ˜€ 1:πŸ€¦πŸΎβ€β™€οΈ

forEachWhile()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.forEachWhile((e) {
                                          print(e.value);
                                          return e.value == 'πŸ˜€';
                                          }); // πŸ˜€ πŸ€¦πŸΎβ€β™€οΈ

forEachIndexedWhile()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.forEachIndexedWhile((i, e) {
                                                    print('$i:${e.value}');
                                                    return e.value == 'πŸ˜€';
                                                    }); // 0:πŸ˜€ 1:πŸ€¦πŸΎβ€β™€οΈ

join()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.join((e) => e.value, 
                              separator: '.', 
                              prefix: 'prefix', 
                              suffix: 'suffix'); // 'prefixπŸ˜€.πŸ€¦πŸΎβ€β™€οΈsuffix'

map()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.map((e) => 'Emoji: ${e.name}'); // [Emoji: Grinning Face, Emoji: Woman Facepalming: Medium-Dark Skin Tone]

mapIndexed()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.mapIndexed((i, e) => '$i: ${e.name}'); // [0: Grinning Face, 1: Woman Facepalming: Medium-Dark Skin Tone]

none()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.none((e) => e.value == 'πŸ‘πŸ»'); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.none((e) => e.value == 'πŸ˜€'); // false

noneOf()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.noneOf(['πŸ‘πŸ»']); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.noneOf(['πŸ‘πŸ»', 'πŸ€¦πŸΎβ€β™€οΈ']); // false
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.noneOf(['πŸ˜€', 'πŸ€¦πŸΎβ€β™€οΈ']); // false

removeAt()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.removeAt(0); // textπŸ€¦πŸΎβ€β™€οΈ
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.removeAt(10); // πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ

removeFromEnd()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.removeFromEnd(0); // πŸ˜€text
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.removeFromEnd(10); // πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ

removeEveryOf()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ‘πŸ»textπŸ˜€'.emojis.removeEveryOf(['πŸ˜€', 'πŸ‘πŸ»']); // textπŸ€¦πŸΎβ€β™€οΈtexttext

removeWhereIndexed()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.removeWhereIndexed((i, e) => i == 0 && e.value == 'πŸ˜€'); // textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€

replaceWhereIndexed()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.replaceWhereIndexed((i, e) => i == 1 ? '_123_' : null); // πŸ˜€text_123_textπŸ˜€

skip()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ‘πŸ»'.emojis.skip(1); // [Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...), Emoji(value: πŸ‘πŸ», ...)]

skipLast()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ‘πŸ»'.emojis.skipLast(1); // [Emoji(value: πŸ˜€, ...), Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...)]

skipWhile()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ‘πŸ»'.emojis.skipWhile((e) => e.value == 'πŸ˜€'); // [Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...), Emoji(value: πŸ‘πŸ», ...)]

some()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.some((e) => e.value == 'πŸ˜€'); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.some((e) => e.value == 'πŸ‘πŸ»'); // false

someOf()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.someOf(['πŸ˜€']); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.someOf(['πŸ˜€', 'πŸ‘πŸ»']); // true
'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈ'.emojis.someOf(['πŸ‘πŸ»']); // false

splitWhere()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.splitWhere((e) => e.value == 'πŸ€¦πŸΎβ€β™€οΈ'); // [πŸ˜€text, textπŸ˜€]

splitWhereIndexed()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ˜€'.emojis.splitWhereIndexed((i, e) => i == 1 && e.value == 'πŸ€¦πŸΎβ€β™€οΈ'); // [πŸ˜€text, textπŸ˜€]

lastWhere()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.lastWhere((e) => e.name.contains('Woman')); // Emoji(value: πŸ€¦πŸ»β€β™€οΈ, ...)

lastWhereIndexed()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.lastWhereIndexed((i, e) => i == 0 && e.name.contains('Woman')); // Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...)

lastWhereOrNull()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.lastWhereOrNull((e) => e.name.contains('Woman')); // Emoji(value: πŸ€¦πŸ»β€β™€οΈ, ...)

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.lastWhereOrNull((e) => e.value == 'πŸ‘πŸ»'); // null

lastWhereIndexedOrNull()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.lastWhereIndexedOrNull((i, e) => i == 0 && e.name.contains('Woman')); // Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...)

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.lastWhereIndexedOrNull((i, e) => i == 0 && e.value == 'πŸ˜€'); // null

take()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ‘πŸ»'.emojis.take(2); // [Emoji(value: πŸ˜€, ...), Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...)]

takeLast()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ‘πŸ»'.emojis.takeLast(2); // [Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...), Emoji(value: πŸ‘πŸ», ...)]

takeWhile()

'πŸ˜€textπŸ€¦πŸΎβ€β™€οΈtextπŸ‘πŸ»'.emojis.takeWhile((e) => e.value == 'πŸ˜€'); // [Emoji(value: πŸ˜€, ...)]

where()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.where((e) => e.name.contains('Woman')); // [Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...), Emoji(value: πŸ€¦πŸ»β€β™€οΈ, ...)]

whereIndexed()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.whereIndexed((i, e) => i == 0 && e.name.contains('Woman')); // [Emoji(value: πŸ€¦πŸΎβ€β™€οΈ, ...)]

whereNot()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.whereNot((e) => e.name.contains('Woman')); // [Emoji(value: πŸ˜€, ...)]

whereNotIndexed()

'πŸ€¦πŸΎβ€β™€οΈtextπŸ˜€textπŸ€¦πŸ»β€β™€οΈ'.emojis.whereNotIndexed((i, e) => i == 0 && e.name.contains('Woman')); // [Emoji(value: πŸ˜€, ...), Emoji(value: πŸ€¦πŸ»β€β™€οΈ, ...)]

0.3.0 #

  • Updated emoji dataset to newest Unicode 15.1
  • Extended data about emoji including:
    • apple name
    • also known as
    • version
    • status

Example:

Emoji(
  value: πŸ˜†,
  unicode: 1F606,
  name: Grinning Squinting Face,
  appleName: Grinning Face with Squinting Eyes,
  alsoKnownAs: [><, Closed-Eyes Smile, Big Grin, Laughing, XD],
  group: Smileys & Emotion,
  subgroup: face-smiling,
  version: 6.0,
  status: fully-qualified,
  shortcodes: [
    Shortcode(
    platform: Default,
    values: [grinning_squinting_face]
  ), 
    Shortcode(
    platform: CLDR,
    values: [grinning_squinting_face]
  ), 
    Shortcode(
    platform: Discord,
    values: [laughing, satisfied]
  ), 
    Shortcode(
    platform: Github,
    values: [laughing, satisfied]
  ), 
    Shortcode(
    platform: Slack,
    values: [laughing, satisfied]
  )]
)
  • Added replaceWhere method:
'πŸ˜€_text_πŸ‘πŸ»'.emojis.replaceWhere((e) => e.value == 'πŸ‘πŸ»' ? 'OK' : null); // πŸ˜€_text_OK

'πŸ˜€_text_πŸ‘πŸ»'.emojis.replaceWhere((e) => {'πŸ˜€':'ABC', 'πŸ‘πŸ»':'123'}[e.value]); // ABC_text_123

Warning

Deprecated any getter -> use contains instead

Deprecated replaceEach method -> use replaceWith instead

Deprecated hasAny method -> use anyOf instead

Deprecated hasEach method -> use everyOf instead

0.2.0 #

  • Added optional fallback function onUnknownShortcode when parsing String with unknown shortcode:
const text = ':man: :this-shortcode-does-not-exist: :woman:';
final result = text.fromShortcodes(onUnknownShortcode: (_) => '🀷');
print(result); // 'πŸ‘¨ 🀷 πŸ‘©'
  • Added support for parsing chained emojis:
const text = ':otter::woman-facepalming::skin-tone-5::santa::dancer::skin-tone-4::female-astronaut::skin-tone-5:';
final result = text.fromShortcodes();
print(result); // 'πŸ¦¦πŸ€¦πŸΎβ€β™€οΈπŸŽ…πŸ’ƒπŸ½πŸ‘©πŸΎβ€πŸš€'

0.1.3 #

  • Updated description
  • Updated README

0.1.2 #

  • Updated dependencies
  • Updated the SDK constraint to '>=2.18.6 <4.0.0'

0.1.1 #

  • Formatted code
  • Updated description
  • Updated lint rules
  • Improved documentation
  • Improved README

0.1.0 #

Initial release πŸŽ‰

7
likes
160
points
841
downloads
screenshot

Publisher

verified publisherdominikkrajcer.com

Weekly Downloads

Emojis for Flutter & Dart (Unicode 16.0) + one, yet powerful emojis String extension

Repository (GitHub)
View/report issues

Topics

#emoji #emojis #collection #unicode

Documentation

API reference

License

MIT (license)

Dependencies

collection

More

Packages that depend on emoji_extension