Docs
This commit is contained in:
parent
78fe9e7b09
commit
c7324a6b19
458 changed files with 93141 additions and 47 deletions
|
@ -1,7 +1,7 @@
|
|||
abstract class ConstValues {
|
||||
static const String httpsScheme = 'https';
|
||||
static const String backendHost = 'source.unsplash.com';
|
||||
static const List<String> backendUrlPathSegments = ['user', 'c_v_r'];
|
||||
static const String imagesHostServer = 'source.unsplash.com';
|
||||
static const List<String> imagesHostUrlPathSegments = ['user', 'c_v_r'];
|
||||
|
||||
static const int numberOfImages = 25;
|
||||
static const int minImageSize = 50;
|
||||
|
|
|
@ -2,9 +2,14 @@ extension StringExtensions on String {
|
|||
/// Returns true if given word contains atleast all the characters in [targetChars], and `false` otherwise
|
||||
///
|
||||
/// Very efficient `O(n)` instead of naive `O(n*m)`
|
||||
bool containsAllCharacters({required String targetChars}) {
|
||||
final Set<String> characterSet = Set.from(targetChars.split(''));
|
||||
for (final testChar in split('')) {
|
||||
bool containsAllCharacters({
|
||||
required String targetChars,
|
||||
bool ignoreCase = true,
|
||||
}) {
|
||||
final Set<String> characterSet = ignoreCase
|
||||
? Set.from(targetChars.toLowerCase().split(''))
|
||||
: Set.from(targetChars.split(''));
|
||||
for (final testChar in ignoreCase ? toLowerCase().split('') : split('')) {
|
||||
characterSet.remove(testChar);
|
||||
if (characterSet.isEmpty) return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue