Skip to content

When you need a function param that accepts type or type value f.e. integer or String - nothing else. The values are carried by container class and types errors are compile time or in editor ones.

Notifications You must be signed in to change notification settings

brilliapps/multitypes-multivalues

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

multitypes-multivalues

When you need a function param that accepts type or type value f.e. integer or String - nothing else. The values are carried by container class and types errors are compile time or in editor ones. So you can code and shouldn't see any error or exception whe your app is running. You can access (get, set) the value using .v property of a Types, MTypes, Types3 object and the type of v cannot be changed. There is going to be a Values class (carrying one of several possible values) corresponding to Types but it is not going to throw errors in compilation time (or in editor before commpilation). You alway create an object of Types class using it's extending classess TypesV for the first optional type, TypesW for the second optional type. See examples. The remaining Mtypes and Types3 classees work similarly (all should has been better tested).

In short just a not sofisticated dart file multi_types.dart contains three classess with examples. It is recommended that you use Types<V, W> class for two optional types (the class contains one type value of two types given in generic), or Types3<V, W, U> for three optional types. You can use MTypes<V, W> for two or three types but this class is a bit more resources draining so use it for more than 3 optional types, because the Types class is totally simple and by this should be like natively fast.

About

When you need a function param that accepts type or type value f.e. integer or String - nothing else. The values are carried by container class and types errors are compile time or in editor ones.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages