letsar / binder

A lightweight, yet powerful way to bind your application state with your business logic.
MIT License
178 stars 12 forks source link

compiler problems #12

Closed jmls closed 3 years ago

jmls commented 3 years ago

I'm both a flutter and binder newbie, so please go easy if this is a stupid question ;)

I'm playing around with the examples , and I'm just wondering how to make this warning go away ..

image

the code in question is

image

as you can see, the "watch" is underlined in blue

There are also several deprecated notices - once I get the examples running I can try and get those fixed and submit a PR if that's useful ?

letsar commented 3 years ago

Hi,

There are no stupid questions, we are all learning something new every day ๐Ÿ˜‰.

I also had this annoying issue, which have already been reported here. For the moment you can add this rule in the analysis_options.yaml (see this example for the whole file example):

top_level_function_literal_block: ignore

Which deprecating notice do you refer to?

jmls commented 3 years ago

Thanks ๐Ÿ˜Š the deprecation messages are for raised button and flatbutton, replaced with elevated button and text button

letsar commented 3 years ago

Ah yes, I need to replace them :+1:

erf commented 3 years ago

@jmls

To remove the warning you need to add the generic type to Computed, in your case bool, because as the warning says, it can't be infered.

Example:


final something = Computed<bool>((watch) {
  return true;
});
ยด``
jmls commented 3 years ago

@erf, yup that worked for me ;) thanks