bazrafkan / google_place

A new Flutter package for handle google place api
MIT License
84 stars 126 forks source link

Locationbias error: Failed assertion: line 42 pos 14: 'point != null && circular != null && rectangular != null': is not true. #46

Open jbacco opened 2 years ago

jbacco commented 2 years ago

Setting a circular Locationbias for getFindPlace() results in the following failed assertion: Failed assertion: line 42 pos 14: 'point != null && circular != null && rectangular != null': is not true.

  Locationbias({this.ipbias, this.point, this.circular, this.rectangular}) {
    if (ipbias != null && ipbias!) {
      assert(point == null);
      assert(circular == null);
      assert(rectangular == null);
    }
    if (point != null) {
      assert(ipbias == null);
      assert(circular == null);
      assert(rectangular == null);
    }
    if (circular != null) {
      assert(ipbias == null);
      assert(point == null);
      assert(rectangular == null);
    }
    if (rectangular != null) {
      assert(ipbias == null);
      assert(point == null);
      assert(circular == null);
    }
    if (ipbias == null || ipbias!)
      assert(point != null && circular != null && rectangular != null);
  }

Line 42 states if ipbias is null, then point, circular, and rectangular should all be non-null. Is this intentional, or were those supposed to be logical OR conditions?

DavidTimbwa commented 2 years ago

Any updates on this? The LocationBias is unusable because of the faulty assertions.