Skip to content

Some of useful extension for manipulate text and data sets in flutter

Notifications You must be signed in to change notification settings

udithperera-dev/flutter-extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

flutter-extensions

Some of useful extension for manipulate text and data sets in flutter

Unique Extension(Remove Duplicates from List)

Example for Value List:

    List<int> list = [1,1,1,2,4,5,8,8];
    list.unique((x) => x);
    Output: [1,2,4,5,8]

Example for Model List:

    List<Man> manList = [
                          Man(name:'a',height: 2),
                          Man(name:'a',height: 2),
                          Man(name:'b',height: 3),
                          Man(name:'c',height: 2),
                          Man(name:'d',height: 5),
                          Man(name:'d',height: 2),
                        ];

Unique List by Name

    list.unique((x) => x.name);
    Output: [
              Man(name:'a',height: 2),
              Man(name:'b',height: 3),
              Man(name:'c',height: 2),
              Man(name:'d',height: 5)
            ]

Unique List by Height

    list.unique((x) => x.height);
    Output: [
                Man(name:'a',height: 2),
                Man(name:'b',height: 3),
                Man(name:'d',height: 5)
            ]

About

Some of useful extension for manipulate text and data sets in flutter

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages