fixed_collections 0.5.0-beta copy "fixed_collections: ^0.5.0-beta" to clipboard
fixed_collections: ^0.5.0-beta copied to clipboard

Collections you can't modify. Use lists that give you compile-time errors if you make calls to modify the list.

fixed_collections #

This library contains fixed (immutable) collections. You pass an Iterable, Set or Map into the constructor and get a collection you cannot modify. More importantly, all the members that modify the list are deprecated, so you get a warning or error at compile time. Use this library with the deprecated_member_use_from_same_package code analysis option.

Why Use This Library? #

The collections in this library are normal Lists, Sets and Maps, unlike other immutable collections. They implement the interfaces for these. You can pass them around in your app and pass them to external functions that accept these collections as parameters, but if your code mutates the list, you will see warnings.

image

Errors #

Turn on the rule deprecated_member_use_from_same_package by adding it to your analysis_options.yaml file. Or, use the austerity package to make your Dart experience much more strict.

analyzer:
  errors:
    deprecated_member_use_from_same_package: error

If you want a less severe warning, you can use warning instead of error.

analyzer:
  errors:
    deprecated_member_use_from_same_package: warning

Read more about customizing analysis errors here.

7
likes
140
pub points
55%
popularity

Publisher

verified publisherchristianfindlay.com

Collections you can't modify. Use lists that give you compile-time errors if you make calls to modify the list.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

More

Packages that depend on fixed_collections