srawlins / timezone

Time zone database and time zone aware DateTime object for Dart.
BSD 2-Clause "Simplified" License
102 stars 54 forks source link

Move methods into a factory/singleton. #43

Open bsutton opened 4 years ago

bsutton commented 4 years ago

Thanks for the work on creating a timezone package for dart.

I do have a complaint in that all of the methods are exposed as global functions.

This has the affect of polluting the global namespace.

Whist dart does allow us to import using the 'as ..' clause this should really be used for remapping conflicting package names rather than for managing a collection of global functions.

Can we look at moving all of the global methods into a factory singleton?

This would also help with auto completion when editing as you only need to remember the singleton class name rather than each individual function.

The class name 'Locations' seems to be a likely candidate.