0 purchases
coder matthews extensions
A variety of extensions I use in my projects.
Features #
Package contains extensions for lists, strings, maps and async functions. Along with useful functions
copied to clipboard
Getting started #
No setup required, just import the package.
Usage #
List Extensions #
final personList = [
CoderPerson(name: "Jane", age: 16, gender: Gender.female),
CoderPerson(name: 'Bob', age: 20, gender: Gender.male),
CoderPerson(name: 'King', age: 56, gender: Gender.male),
];
final oldestPerson = personList.maxElement((element) => element.age);
final youngestPerson = personList.minElement((element) => element.age);
final totalAges = personList.sum((element) => element.age);
final isListNullOrEmpty = personList.isNullOrEmpty;
copied to clipboard
String Extensions #
var control = '(342) 342-2314';
var result = number.toPhoneNumberString;
String email = '[email protected]';
email.isEmail;
copied to clipboard
Map Extensions #
Removes null values
var testMap = <String, dynamic>{
'name': 'Tom',
'age': null,
'location': 'USA'
};
var newMap = testMap.removeNulls;
copied to clipboard
1
Checking if your device is a tablet #
var isTablet = await CoderMatthewsExtensions.isTablet();
copied to clipboard
Check example folder for more.
Additional information #
N/A
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.