Weather

Sets weather listener

The watch can save real-time weather for 2 hours, and the weather information will be cleared after 2 hours. When the watch does not have today's weather information, the watch will reset the weather when it switches to the weather interface.

Sets the weather to monitor weatherChangeEveStm, return the update result of the weather status through the data stream, and return it as a WeatherChangeBean object.

 _blePlugin.weatherChangeEveStm.listen(
        (WeatherChangeBean event) {
          /// Do something with new state,for example:
          setState(() {
            switch (event.type) {
              case WeatherChangeType.updateWeather:
                break;
              case WeatherChangeType.tempUnitChange:
                _weather = event.tempUnit!;
                break;
              default:
                break;
            }
          });
        });

callback Description :

WeatherChangeBean:

callback valuecallback typecallback description
typeintWeather change return value type, the type is WeatherChangeType
tempUnitintTemperature unit

WeatherChangeType:

typevaluevalue description
updateWeather1Represents the data returned by the weather change monitor
tempUnitChange2Represents the data returned by the temperature change monitor

Sets today's weather

Set the watch's weather for today.

_blePlugin.sendTodayWeather(TodayWeatherBean info);

Parameter Description :

TodayWeatherBean:

valuevalue typevalue description
cityStringCity
lunarStringLunar Festival (not necessary)
festivalStringfestival(not necessary)
pm25intPM2.5
tempintReal-time temperature
weatherIdintWeather status,Parameter source WeatherId

WeatherId:

typevaluevalue description
cloudy0partly cloudy
foggy1fog
overcast2overcast
rainy3rainy
snowy4snowy
sunny5sunny
sandstorm6sandstorm
haze7haze

Sets weather in the next 7 days

Sets the weather for the next 7 days to the watch.

_blePlugin.sendFutureWeather(FutureWeatherListBean info);

Parameter Description :

FutureWeatherListBean:

valuevalue typevalue description
futureList< FutureWeatherBean >future weather

FutureWeatherBean:

valuevalue typevalue description
weatherIdintweather Id
lowTemperatureintlowest temperature
highTemperatureintmaximum temperature
Last Updated: