gen_lang icon indicating copy to clipboard operation
gen_lang copied to clipboard

allow multiple parameters

Open maks opened this issue 5 years ago • 2 comments

I really love this package and would like to use it instead of my own hand-rolled solution, but I need to be able to pass in multiple parameters for some messages. Would it be possible to add that as an option?

maks avatar Dec 11 '19 09:12 maks

Any example to present your idea?

KingWu avatar Dec 11 '19 15:12 KingWu

Yes sorry fo the lack of detail. What I had in mind was being able to have thins like:

{
    "messageWithMultiParams": "Hi ${yourName} its ${now} and the temperature outside is ${temp}"
}

I'm not sure about what the best function signature, ideally we could have:

 S.of(context).messageWithMultiParams(yourname: 'Maks', now: '10:12am', temp: '21C');

with the named params also being marked with @required but even just passing in a List or Map as the param would be ok.

maks avatar Dec 12 '19 22:12 maks