Skip to content

Commit

Permalink
update sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjaysong committed Sep 29, 2021
1 parent fc03696 commit c128822
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 29 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.5

- update sdk.
- 升级 SDK

## 0.0.4

- update sdk.
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation files('libs/QWeather_Public_Android_V4.5.jar')
compile 'com.squareup.okhttp3:okhttp:3.9.0+'
compile 'com.google.code.gson:gson:2.6.2+'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.squareup.okhttp3:okhttp:3.9.0+'
implementation 'com.google.code.gson:gson:2.6.2+'
}
Binary file not shown.
6 changes: 2 additions & 4 deletions ios/QWeather.framework/Headers/AllWeatherInquieirs.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ typedef NS_ENUM(NSInteger, BASIN_TYPE) {
BASIN_TYPE_SI,//南印度洋
};

UIKIT_EXTERN NSString * const INDICES_TYPESTRING[];

typedef NS_ENUM(NSInteger, SERCHMODE_TYPE) {
SERCHMODE_TYPE_EXACT= 0,//精准查询
SERCHMODE_TYPE_FUZZY = 1,//模糊搜索
Expand Down Expand Up @@ -261,11 +259,11 @@ typedef NS_ENUM(NSInteger, SERCHMODE_TYPE) {

/**
生活指数数据类型,包括洗车指数、穿衣指数、钓鱼指数等。可以一次性获取多个类型的生活指数.
indices内 放入需要的INDICES_TYPESTRING类型,默认indices = @[INDICES_TYPESTRING[INDICES_TYPE_comf]]
indices内 放入需要的NSNumber类型,默认indices = @[[NSNumber numberWithInt:INDICES_TYPE_comf]]
具体生活指数的类型参数值如下:
*/
@property (nonatomic, strong) NSArray *indices;
@property (nonatomic, strong) NSArray<NSNumber *> *indices;

/**
选择POI所在城市,可设定只搜索在特定城市内的POI信息。城市名称可以是中文、英文或城市的LocationID。默认全世界范围。
Expand Down
2 changes: 1 addition & 1 deletion ios/QWeather.framework/Headers/QWeather.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FOUNDATION_EXPORT const unsigned char QWeatherVersionString[];
// #import <QWeather/QWeather.h>


/* 当前版本 2021-05-17 4.4 */
/* 当前版本 2021-07-20 4.5 */

/**
* 写在前面的(废)话
Expand Down
Binary file modified ios/QWeather.framework/Info.plist
Binary file not shown.
Binary file modified ios/QWeather.framework/QWeather
Binary file not shown.
1 change: 0 additions & 1 deletion ios/flutter_qweather.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ A qweather Flutter plugin.

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
s.swift_version = '5.0'
end
8 changes: 4 additions & 4 deletions lib/api/geo_api.dart → lib/apis/geo_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mixin _Geo on _ServiceApi {
"range": range.isEmpty ? 'world' : range,
"number": Platform.isAndroid ? number : number.toString()
};
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GeoCityLookup, param);
return value == null ? null : GeoPoiLocationResp.fromMap(value);
}
Expand All @@ -22,7 +22,7 @@ mixin _Geo on _ServiceApi {
"range": range.isEmpty ? 'world' : range,
"number": Platform.isAndroid ? number : number.toString()
};
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GetGeoTopCity, param);
return value == null ? null : GeoPoiLocationResp.fromMap(value);
}
Expand All @@ -47,7 +47,7 @@ mixin _Geo on _ServiceApi {
// param["type"] = "TSTA";
// break;
// }
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GeoPoiLookup, param);
return value == null ? null : GeoPoiLocationResp.fromMap(value);
}
Expand All @@ -72,7 +72,7 @@ mixin _Geo on _ServiceApi {
// param["type"] = "TSTA";
// break;
// }
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GeoPoiRangeLookup, param);
return value == null ? null : GeoPoiLocationResp.fromMap(value);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/api/indices_api.dart → lib/apis/indices_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mixin _Indices on _ServiceApi {
"location": location,
"indicesTypes": indicesTypes.map((e) => e.code).toList()
};
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GetIndices1Day, param);
return value == null ? null : DailyIndicesResp.fromMap(value);
}
Expand All @@ -29,7 +29,7 @@ mixin _Indices on _ServiceApi {
"location": location,
"indicesTypes": indicesTypes.map((e) => e.code).toList()
};
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GetIndices3Day, param);
return value == null ? null : DailyIndicesResp.fromMap(value);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/api/weather_api.dart → lib/apis/weather_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of qweather;
mixin _Weather on _ServiceApi {
/// [获取实时天气]: https://dev.qweather.com/docs/android-sdk/android-weather/#接口参数说明
Future<WeatherNowResp?> getWeatherNow(String location) async {
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GetWeatherNow, location);
return value == null ? null : WeatherNowResp.fromMap(value);
}
Expand All @@ -29,7 +29,7 @@ mixin _Weather on _ServiceApi {
param["daily"] = 15;
break;
}
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GetWeatherDaily, param);
return value == null ? null : WeatherDailyResp.fromMap(value);
}
Expand All @@ -51,14 +51,14 @@ mixin _Weather on _ServiceApi {
param["hourly"] = 168;
break;
}
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GetWeatherHourly, param);
return value == null ? null : WeatherHourlyResp.fromMap(value);
}

/// [获取中国地区未来2小时内每5分钟降水数据]: https://dev.qweather.com/docs/android-sdk/android-weather/#接口参数说明-3
Future<WeatherMinutelyResp?> getWeatherMinuteLy(String location) async {
Map? value = await methodChannel.invokeMapMethod(
Map? value = await _methodChannel.invokeMapMethod(
MethodConstants.GetWeatherMinuteLy, location);
return value == null ? null : WeatherMinutelyResp.fromMap(value);
}
Expand Down
15 changes: 7 additions & 8 deletions lib/flutter_qweather.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import 'constants.dart';
export 'models/geo.dart';
export 'models/weather.dart';

part 'api/geo_api.dart';
part 'apis/geo_api.dart';

part 'api/indices_api.dart';
part 'apis/indices_api.dart';

part 'api/weather_api.dart';
part 'apis/weather_api.dart';

/// 和风天气配置
class QweatherConfig {
Expand Down Expand Up @@ -54,10 +54,10 @@ class FlutterQweather extends _ServiceApi with _Geo, _Indices, _Weather {
}

class _ServiceApi {
final methodChannel = MethodChannel('com.fluttercandies.qweather');
final _methodChannel = MethodChannel('com.fluttercandies.qweather');

Future<String> get platformVersion async {
final String? version = await methodChannel
final String? version = await _methodChannel
.invokeMethod<String>(MethodConstants.GetPlatformVersion);
return version!;
}
Expand All @@ -80,13 +80,12 @@ class _ServiceApi {
"biz": config.biz,
"debug": config.debug
};
final ok = await methodChannel.invokeMethod(MethodConstants.Init, param);
final ok = await _methodChannel.invokeMethod(MethodConstants.Init, param);
if (config.debug) print("和风天气:初始化结果: $ok");
return;
}

/// 设置 Debug
Future<void> setDebug([bool debug = true]) async {
return await methodChannel.invokeMethod(MethodConstants.SetDebug, debug);
return await _methodChannel.invokeMethod(MethodConstants.SetDebug, debug);
}
}
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: flutter_qweather
description: A qweather Flutter plugin. Free use of qweather api. Only Android and IOS platforms are supported.
version: 0.0.4
version: 0.0.5
homepage: https://github.com/fluttercandies/flutter_qweather

publish_to: https://pub.dev
environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"
Expand Down

0 comments on commit c128822

Please sign in to comment.