Dose Flutter or Dart have any method equivalent to hasProperty() method in JS or isset method in PH

3125 views dart
-1

Dose Flutter or Dart have any method equivalent to hasProperty() method in JS or isset method in PHP. for example: x.hasOwnProperty('y')

answered question

1 Answer

12

Using reflection, you could make one. The thing is, dart:mirror is disabled in Flutter. So no.

The recommended solution is instead to use code-generators using source_gen

You can take a look at reflectable, a code-generation library that mimics reflection.

posted this

Have an answer?

JD

Please login first before posting an answer.