Commit ac42899a authored by 汪林玲's avatar 汪林玲

null-safety

parent 72c99147
class ConfigEntity { class ConfigEntity {
String isAuditMode; String? isAuditMode;
String version; String? version;
String adSwitch; String? adSwitch;
ConfigEntity({this.isAuditMode,this.version,this.adSwitch}); ConfigEntity({this.isAuditMode,this.version,this.adSwitch});
static ConfigEntity fromJson(Map<String, dynamic> json) { static ConfigEntity fromJson(Map<String, dynamic>? json) {
return ConfigEntity( return ConfigEntity(
isAuditMode: json['is_audit_mode']?.toString(), isAuditMode: json!['is_audit_mode']?.toString(),
version: json['version']?.toString(), version: json['version']?.toString(),
adSwitch: json['ad_switch']?.toString(), adSwitch: json['ad_switch']?.toString(),
); );
......
class MapPlaceEntity { class MapPlaceEntity {
String id; String? id;
String title; String? title;
String address; String? address;
String category; String? category;
int type; int? type;
MapLocation location; MapLocation? location;
int adcode; int? adcode;
String province; String? province;
String city; String? city;
String district; String? district;
MapPlaceEntity({ MapPlaceEntity({
this.id, this.id,
...@@ -23,15 +23,15 @@ class MapPlaceEntity { ...@@ -23,15 +23,15 @@ class MapPlaceEntity {
this.district this.district
}); });
static MapPlaceEntity fromJson(Map<String, dynamic> json) { static MapPlaceEntity fromJson(Map<String, dynamic>? json) {
return MapPlaceEntity( return MapPlaceEntity(
id: json['id']?.toString(), id: json!['id']?.toString(),
title: json['title']?.toString(), title: json['title']?.toString(),
address: json['address']?.toString(), address: json['address']?.toString(),
category: json['category']?.toString(), category: json['category']?.toString(),
type: json['type'] as int, type: json['type'] as int?,
location:MapLocation.fromJson(json['location']), location:MapLocation.fromJson(json['location']),
adcode: json['adcode'] as int, adcode: json['adcode'] as int?,
province: json['province']?.toString(), province: json['province']?.toString(),
city: json['city']?.toString(), city: json['city']?.toString(),
district: json['district']?.toString(), district: json['district']?.toString(),
...@@ -40,16 +40,16 @@ class MapPlaceEntity { ...@@ -40,16 +40,16 @@ class MapPlaceEntity {
} }
class MapLocation { class MapLocation {
double lat; double? lat;
double lng; double? lng;
MapLocation({ MapLocation({
this.lat, this.lat,
this.lng this.lng
}); });
static MapLocation fromJson(Map<String, dynamic> json) { static MapLocation fromJson(Map<String, dynamic> json) {
return MapLocation( return MapLocation(
lat:json['lat'] as double, lat:json['lat'] as double?,
lng:json['lng'] as double, lng:json['lng'] as double?,
); );
} }
} }
\ No newline at end of file
class ProductDetailsEntity { class ProductDetailsEntity {
String id; String? id;
String itemId; String? itemId;
String itemTitle; String? itemTitle;
String platform; String? platform;
List<String> itemPics; List<String>? itemPics;
String price; String? price;
String itemStatus; String? itemStatus;
String endPrice; String? endPrice;
String special; String? special;
String description; String? description;
String collegeTimes; String? collegeTimes;
String likeTimes; String? likeTimes;
String releaseTime; String? releaseTime;
String buttonText; String? buttonText;
List<CouponInfo> couponInfos; List<CouponInfo>? couponInfos;
String userCommission; String? userCommission;
String isCollect; String? isCollect;
String isLike; String? isLike;
String checkText; String? checkText;
String shareUrl; String? shareUrl;
String shareMessage; String? shareMessage;
String couponText; String? couponText;
String isOverdue; String? isOverdue;
String shopTitle; String? shopTitle;
String rebate; String? rebate;
List<dynamic> collectOrders; List<dynamic>? collectOrders;
Map<String,dynamic> newItemInfo; Map<String,dynamic>? newItemInfo;
ProductDetailsEntity({ ProductDetailsEntity({
this.id, this.id,
...@@ -57,8 +57,8 @@ class ProductDetailsEntity { ...@@ -57,8 +57,8 @@ class ProductDetailsEntity {
this.newItemInfo this.newItemInfo
}); });
static ProductDetailsEntity fromJson(Map<String, dynamic> json) { static ProductDetailsEntity fromJson(Map<String, dynamic>? json) {
List<dynamic> couponInfos = List<dynamic>.from(json['coupon_info']); List<dynamic> couponInfos = List<dynamic>.from(json!['coupon_info']);
return ProductDetailsEntity( return ProductDetailsEntity(
id: json['id']?.toString(), id: json['id']?.toString(),
itemId: json['item_id']?.toString(), itemId: json['item_id']?.toString(),
...@@ -93,9 +93,9 @@ class ProductDetailsEntity { ...@@ -93,9 +93,9 @@ class ProductDetailsEntity {
class CouponInfo { class CouponInfo {
String url; String? url;
String couponName; String? couponName;
String status; String? status;
CouponInfo({this.url,this.couponName,this.status}); CouponInfo({this.url,this.couponName,this.status});
static CouponInfo fromJson(Map<String, dynamic> json) { static CouponInfo fromJson(Map<String, dynamic> json) {
......
class ProductItemEntity { class ProductItemEntity {
String id; String? id;
String platform; String? platform;
String itemTitle; String? itemTitle;
String itemPic; String? itemPic;
String special; String? special;
String releaseTime; String? releaseTime;
String endPrice; String? endPrice;
String descriptionText; String? descriptionText;
List<dynamic> tags; List<dynamic>? tags;
String rebate; String? rebate;
ProductItemEntity({this.id,this.platform,this.itemTitle,this.itemPic,this.special,this.releaseTime,this.rebate,this.tags,this.descriptionText,this.endPrice}); ProductItemEntity({this.id,this.platform,this.itemTitle,this.itemPic,this.special,this.releaseTime,this.rebate,this.tags,this.descriptionText,this.endPrice});
static ProductItemEntity fromJson(Map<String, dynamic> json) { static ProductItemEntity fromJson(Map<String, dynamic>? json) {
return ProductItemEntity( return ProductItemEntity(
id: json['id']?.toString(), id: json!['id']?.toString(),
platform: json['platform']?.toString(), platform: json['platform']?.toString(),
itemTitle: json['item_title']?.toString(), itemTitle: json['item_title']?.toString(),
itemPic: json['item_pic']?.toString(), itemPic: json['item_pic']?.toString(),
......
class SharePosterEntity { class SharePosterEntity {
String url; String? url;
List<String> sharePoster; List<String>? sharePoster;
SharePosterEntity({this.url,this.sharePoster}); SharePosterEntity({this.url,this.sharePoster});
......
class SuningItemEntity { class SuningItemEntity {
String itemId; String? itemId;
String sellerId; String? sellerId;
String itemPic; String? itemPic;
String itemTitle; String? itemTitle;
String discountType; String? discountType;
String discountAmount; String? discountAmount;
String shopTitle; String? shopTitle;
String userCommission; String? userCommission;
String price; String? price;
String endPrice; String? endPrice;
String volumeText; String? volumeText;
String platform; String? platform;
String priceText; String? priceText;
String discountText; String? discountText;
String userCommissionText; String? userCommissionText;
SuningItemEntity({ SuningItemEntity({
...@@ -35,9 +35,9 @@ class SuningItemEntity { ...@@ -35,9 +35,9 @@ class SuningItemEntity {
this.userCommissionText, this.userCommissionText,
}); });
static SuningItemEntity fromJson(Map<String, dynamic> json) { static SuningItemEntity fromJson(Map<String, dynamic>? json) {
return SuningItemEntity( return SuningItemEntity(
itemId: json['item_id']?.toString(), itemId: json!['item_id']?.toString(),
sellerId: json['seller_id']?.toString(), sellerId: json['seller_id']?.toString(),
itemPic: json['item_pic']?.toString(), itemPic: json['item_pic']?.toString(),
itemTitle: json['item_title']?.toString(), itemTitle: json['item_title']?.toString(),
......
class TurnChainEntity { class TurnChainEntity {
String appLink; String? appLink;
String platform; String? platform;
TurnChainEntity({this.appLink,this.platform}); TurnChainEntity({this.appLink,this.platform});
static TurnChainEntity fromJson(Map<String, dynamic> json) { static TurnChainEntity fromJson(Map<String, dynamic>? json) {
return TurnChainEntity( return TurnChainEntity(
appLink: json['app_link']?.toString(), appLink: json!['app_link']?.toString(),
platform: json['platform']?.toString(), platform: json['platform']?.toString(),
); );
} }
......
import 'package:base_repository/base_repository.dart'; import 'package:base_repository/base_repository.dart';
import 'package:flutter/material.dart';
import 'impl/assets_repository_impl.dart'; import 'impl/assets_repository_impl.dart';
/// ///
...@@ -20,7 +19,7 @@ abstract class AssetsRepository { ...@@ -20,7 +19,7 @@ abstract class AssetsRepository {
Future<DSResponseList> itemFreeList({ Future<DSResponseList> itemFreeList({
int page = 1, int page = 1,
int pagesize = 10, int pagesize = 10,
@required int freeType, required int freeType,
}); });
/// ///
...@@ -52,7 +51,7 @@ abstract class AssetsRepository { ...@@ -52,7 +51,7 @@ abstract class AssetsRepository {
/// [id] 数据id /// [id] 数据id
/// ///
Future<DSResponseObject> qryBillRecordDetail({ Future<DSResponseObject> qryBillRecordDetail({
@required String id, required String id,
}); });
/// ///
...@@ -61,8 +60,8 @@ abstract class AssetsRepository { ...@@ -61,8 +60,8 @@ abstract class AssetsRepository {
/// [value] 输入的自定义值 /// [value] 输入的自定义值
/// ///
Future<DSResponseObject> scoreExchange({ Future<DSResponseObject> scoreExchange({
@required String type, required String type,
String value, String? value,
}); });
/// ///
...@@ -74,14 +73,14 @@ abstract class AssetsRepository { ...@@ -74,14 +73,14 @@ abstract class AssetsRepository {
/// 领取任务奖励接口 /// 领取任务奖励接口
/// [id] 任务Id /// [id] 任务Id
/// ///
Future<DSResponseObject> receiveTaskAward({@required String id}); Future<DSResponseObject> receiveTaskAward({required String id});
/// ///
/// 获取广告位id /// 获取广告位id
/// [type] 系统: 1、Android 2、iOS /// [type] 系统: 1、Android 2、iOS
/// [category] 1:激励视频广告 ,2:插屏广告,3:开屏广告 ,4:Banner广告,5.信息流广告,6.全屏广告,7.信息流广告 /// [category] 1:激励视频广告 ,2:插屏广告,3:开屏广告 ,4:Banner广告,5.信息流广告,6.全屏广告,7.信息流广告
/// ///
Future<DSResponseList<Map<String, dynamic>>> videoAdGetSite({@required int type,@required int category}); Future<DSResponseList<Map<String, dynamic>>> videoAdGetSite({required int type,required int category});
/// ///
......
import 'package:base_repository/base_repository.dart'; import 'package:base_repository/base_repository.dart';
import 'package:flutter/material.dart';
import '../assets_repository.dart'; import '../assets_repository.dart';
class AssetsRepositoryImpl extends AssetsRepository { class AssetsRepositoryImpl extends AssetsRepository {
...@@ -13,7 +12,7 @@ class AssetsRepositoryImpl extends AssetsRepository { ...@@ -13,7 +12,7 @@ class AssetsRepositoryImpl extends AssetsRepository {
Future<DSResponseList> itemFreeList({ Future<DSResponseList> itemFreeList({
int page = 1, int page = 1,
int pagesize = 10, int pagesize = 10,
@required int freeType, required int freeType,
}) async { }) async {
dynamic result = await DSDioUtil.getInstance().get( dynamic result = await DSDioUtil.getInstance().get(
'/itemFree.getItemList', '/itemFree.getItemList',
...@@ -26,7 +25,7 @@ class AssetsRepositoryImpl extends AssetsRepository { ...@@ -26,7 +25,7 @@ class AssetsRepositoryImpl extends AssetsRepository {
return DSResponseList.fromJson( return DSResponseList.fromJson(
result, result,
(item){ (item){
String productId = "${item['id']}"; String productId = "${item!['id']}";
Map<String,dynamic> idata = Map<String, dynamic>.from(item); Map<String,dynamic> idata = Map<String, dynamic>.from(item);
idata['product_id'] = productId; idata['product_id'] = productId;
return idata; return idata;
...@@ -39,7 +38,7 @@ class AssetsRepositoryImpl extends AssetsRepository { ...@@ -39,7 +38,7 @@ class AssetsRepositoryImpl extends AssetsRepository {
dynamic result = await DSDioUtil.getInstance().get('/sign.getTask'); dynamic result = await DSDioUtil.getInstance().get('/sign.getTask');
return DSResponseList.fromJson( return DSResponseList.fromJson(
result, result,
(item) => Map<String, dynamic>.from(item), (item) => Map<String, dynamic>.from(item!),
); );
} }
...@@ -61,43 +60,40 @@ class AssetsRepositoryImpl extends AssetsRepository { ...@@ -61,43 +60,40 @@ class AssetsRepositoryImpl extends AssetsRepository {
); );
return DSResponseList.fromJson( return DSResponseList.fromJson(
result, result,
(item) => Map<String, dynamic>.from(item), (item) => Map<String, dynamic>.from(item!),
); );
} }
@override @override
Future<DSResponseObject> qryBillRecordDetail({String id}) async { Future<DSResponseObject> qryBillRecordDetail({String? id}) async {
dynamic result = await DSDioUtil.getInstance() dynamic result = await DSDioUtil.getInstance()
.get('/billRecord.detail', queryParameters: {'id': id}); .get('/billRecord.detail', queryParameters: {'id': id});
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(item) => Map<String, dynamic>.from(item), (item) => Map<String, dynamic>.from(item!),
); );
} }
@override @override
Future<DSResponseObject> receiveTaskAward({String id}) async { Future<DSResponseObject> receiveTaskAward({String? id}) async {
dynamic result = dynamic result =
await DSDioUtil.getInstance().post('/sign.distributeReward',data:{'id':id}); await DSDioUtil.getInstance().post('/sign.distributeReward',data:{'id':id});
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(item) => Map<String, dynamic>.from(item), (item) => Map<String, dynamic>.from(item!),
); );
} }
@override @override
Future<DSResponseObject> scoreExchange({@required String type, String value}) async { Future<DSResponseObject> scoreExchange({required String type, String? value}) async {
Map<String,dynamic> data = {}; Map<String,dynamic> data = {'type':type};
if(type != null){
data['type'] = type;
}
if(value != null){ if(value != null){
data['value'] = value; data['value'] = value;
} }
dynamic result = await DSDioUtil.getInstance().post('/sign.scoreExchange',data:data); dynamic result = await DSDioUtil.getInstance().post('/sign.scoreExchange',data:data);
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(item) => Map<String, dynamic>.from(item), (item) => Map<String, dynamic>.from(item!),
); );
} }
...@@ -107,7 +103,7 @@ class AssetsRepositoryImpl extends AssetsRepository { ...@@ -107,7 +103,7 @@ class AssetsRepositoryImpl extends AssetsRepository {
dynamic result = await DSDioUtil.getInstance().get('/itemFree.getRecord'); dynamic result = await DSDioUtil.getInstance().get('/itemFree.getRecord');
return DSResponseList.fromJson( return DSResponseList.fromJson(
result, result,
(item) => Map<String, dynamic>.from(item), (item) => Map<String, dynamic>.from(item!),
); );
} }
...@@ -117,11 +113,11 @@ class AssetsRepositoryImpl extends AssetsRepository { ...@@ -117,11 +113,11 @@ class AssetsRepositoryImpl extends AssetsRepository {
/// [category] 1:激励视频广告 ,2:插屏广告,3:开屏广告 ,4:Banner广告,5.信息流广告,6.全屏广告,7.信息流广告 /// [category] 1:激励视频广告 ,2:插屏广告,3:开屏广告 ,4:Banner广告,5.信息流广告,6.全屏广告,7.信息流广告
/// ///
@override @override
Future<DSResponseList<Map<String, dynamic>>> videoAdGetSite({int type, int category}) async{ Future<DSResponseList<Map<String, dynamic>>> videoAdGetSite({int? type, int? category}) async{
dynamic result = await DSDioUtil.getInstance().get('/video.getSite',queryParameters:{'type':type,'category':category}); dynamic result = await DSDioUtil.getInstance().get('/video.getSite',queryParameters:{'type':type,'category':category});
return DSResponseList.fromJson( return DSResponseList.fromJson(
result, result,
(item) => Map<String, dynamic>.from(item), (item) => Map<String, dynamic>.from(item!),
); );
} }
...@@ -130,7 +126,7 @@ class AssetsRepositoryImpl extends AssetsRepository { ...@@ -130,7 +126,7 @@ class AssetsRepositoryImpl extends AssetsRepository {
dynamic result = await DSDioUtil.getInstance().post('/video.convert'); dynamic result = await DSDioUtil.getInstance().post('/video.convert');
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
} }
import 'package:flutter/material.dart';
import 'package:base_repository/base_repository.dart'; import 'package:base_repository/base_repository.dart';
import 'package:xiaoxiong_repository/entity/product_details_entity.dart'; import 'package:xiaoxiong_repository/entity/product_details_entity.dart';
import 'package:xiaoxiong_repository/entity/product_item_entity.dart'; import 'package:xiaoxiong_repository/entity/product_item_entity.dart';
...@@ -24,10 +23,10 @@ class PriceRepositoryImpl extends PriceRepository { ...@@ -24,10 +23,10 @@ class PriceRepositoryImpl extends PriceRepository {
Future<DSResponseList<ProductItemEntity>> qryProductList( Future<DSResponseList<ProductItemEntity>> qryProductList(
{int page = 1, {int page = 1,
int pagesize = 10, int pagesize = 10,
String categoryId, String? categoryId,
String excludeId, String? excludeId,
String keywords, String? keywords,
List<dynamic> filters}) async { List<dynamic>? filters}) async {
Map<String, dynamic> query = { Map<String, dynamic> query = {
'page': page, 'page': page,
'pagesize': pagesize, 'pagesize': pagesize,
...@@ -56,7 +55,7 @@ class PriceRepositoryImpl extends PriceRepository { ...@@ -56,7 +55,7 @@ class PriceRepositoryImpl extends PriceRepository {
/// ///
@override @override
Future<DSResponseObject<ProductDetailsEntity>> qryProductDetails( Future<DSResponseObject<ProductDetailsEntity>> qryProductDetails(
{String id}) async { {String? id}) async {
dynamic result = await DSDioUtil.getInstance() dynamic result = await DSDioUtil.getInstance()
.get('itemSelling.detail', queryParameters: {'id': id}); .get('itemSelling.detail', queryParameters: {'id': id});
return DSResponseObject.fromJson(result, ProductDetailsEntity.fromJson); return DSResponseObject.fromJson(result, ProductDetailsEntity.fromJson);
...@@ -68,7 +67,7 @@ class PriceRepositoryImpl extends PriceRepository { ...@@ -68,7 +67,7 @@ class PriceRepositoryImpl extends PriceRepository {
/// [report_type] 举报的商品类型 /// [report_type] 举报的商品类型
/// ///
@override @override
Future<DSResponseBool> report({String id, String reportType}) async { Future<DSResponseBool> report({String? id, String? reportType}) async {
dynamic result = await DSDioUtil.getInstance().post('itemSelling.report', dynamic result = await DSDioUtil.getInstance().post('itemSelling.report',
data: {'id': id, 'report_type': reportType}); data: {'id': id, 'report_type': reportType});
return DSResponseBool.fromJson(result); return DSResponseBool.fromJson(result);
...@@ -80,7 +79,7 @@ class PriceRepositoryImpl extends PriceRepository { ...@@ -80,7 +79,7 @@ class PriceRepositoryImpl extends PriceRepository {
/// ///
@override @override
Future<DSResponseBool> userLike( Future<DSResponseBool> userLike(
{@required String markId, {required String markId,
String type = '2', String type = '2',
String status = '1', String status = '1',
String platform = '20'}) async { String platform = '20'}) async {
...@@ -96,7 +95,7 @@ class PriceRepositoryImpl extends PriceRepository { ...@@ -96,7 +95,7 @@ class PriceRepositoryImpl extends PriceRepository {
@override @override
Future<DSResponseBool> userCollect( Future<DSResponseBool> userCollect(
{String itemId, {String? itemId,
String type = '2', String type = '2',
String platform = '20', String platform = '20',
String status = '1'}) async { String status = '1'}) async {
...@@ -118,8 +117,8 @@ class PriceRepositoryImpl extends PriceRepository { ...@@ -118,8 +117,8 @@ class PriceRepositoryImpl extends PriceRepository {
/// ///
@override @override
Future<DSResponseObject<TurnChainEntity>> turnChainForItemId( Future<DSResponseObject<TurnChainEntity>> turnChainForItemId(
{String itemId, {String? itemId,
String platform, String? platform,
String type = '5', String type = '5',
String sellerId = ''}) async { String sellerId = ''}) async {
Map<String, dynamic> data = { Map<String, dynamic> data = {
...@@ -127,7 +126,7 @@ class PriceRepositoryImpl extends PriceRepository { ...@@ -127,7 +126,7 @@ class PriceRepositoryImpl extends PriceRepository {
'platform': platform, 'platform': platform,
'type': type 'type': type
}; };
if (sellerId != null && sellerId.isNotEmpty) { if (sellerId.isNotEmpty) {
data['seller_id'] = sellerId; data['seller_id'] = sellerId;
} }
dynamic result = await DSDioUtil.getInstance() dynamic result = await DSDioUtil.getInstance()
...@@ -145,8 +144,8 @@ class PriceRepositoryImpl extends PriceRepository { ...@@ -145,8 +144,8 @@ class PriceRepositoryImpl extends PriceRepository {
/// ///
@override @override
Future<DSResponseList<ProductItemEntity>> getSellingRecommends({ Future<DSResponseList<ProductItemEntity>> getSellingRecommends({
String keywords, String? keywords,
String excludeId, String? excludeId,
int page = 1, int page = 1,
int pagesize = 10, int pagesize = 10,
}) async { }) async {
......
import 'package:base_repository/base_repository.dart'; import 'package:base_repository/base_repository.dart';
import 'package:flutter/material.dart';
import '../product_repository.dart'; import '../product_repository.dart';
class ProductRepositoryImpl extends ProductRepository { class ProductRepositoryImpl extends ProductRepository {
...@@ -14,7 +12,7 @@ class ProductRepositoryImpl extends ProductRepository { ...@@ -14,7 +12,7 @@ class ProductRepositoryImpl extends ProductRepository {
Future<DSResponseList> getNines({ Future<DSResponseList> getNines({
int page = 1, int page = 1,
int pagesize = 10, int pagesize = 10,
@required int type, required int type,
}) async { }) async {
dynamic result = dynamic result =
await DSDioUtil.getInstance().get('/item.getNine', queryParameters: { await DSDioUtil.getInstance().get('/item.getNine', queryParameters: {
...@@ -24,17 +22,17 @@ class ProductRepositoryImpl extends ProductRepository { ...@@ -24,17 +22,17 @@ class ProductRepositoryImpl extends ProductRepository {
}); });
return DSResponseList.fromJson( return DSResponseList.fromJson(
result, result,
(item) => Map<String, dynamic>.from(item), (item) => Map<String, dynamic>.from(item!),
); );
} }
@override @override
Future<DSResponseObject> qryGoFreeBuy({String id, int needUrl}) async { Future<DSResponseObject> qryGoFreeBuy({String? id, int? needUrl}) async {
dynamic result = await DSDioUtil.getInstance() dynamic result = await DSDioUtil.getInstance()
.post('/itemFree.goBuy', data: {'id': id, 'need_url': needUrl}); .post('/itemFree.goBuy', data: {'id': id, 'need_url': needUrl});
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
...@@ -44,13 +42,13 @@ class ProductRepositoryImpl extends ProductRepository { ...@@ -44,13 +42,13 @@ class ProductRepositoryImpl extends ProductRepository {
await DSDioUtil.getInstance().get('/itemFree.getShareInfo'); await DSDioUtil.getInstance().get('/itemFree.getShareInfo');
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
@override @override
Future<DSResponseObject> qryFreeProductResult({@required String id}) async{ Future<DSResponseObject> qryFreeProductResult({required String id}) async{
dynamic result = await DSDioUtil.getInstance().get('/itemFree.getItemResult',queryParameters:{'id':id}); dynamic result = await DSDioUtil.getInstance().get('/itemFree.getItemResult',queryParameters:{'id':id});
return DSResponseObject.fromJson(result,(data) => Map<String, dynamic>.from(data)); return DSResponseObject.fromJson(result,(data) => Map<String, dynamic>.from(data!));
} }
} }
...@@ -34,7 +34,7 @@ class SuningRepositoryImpl extends SuningRepository { ...@@ -34,7 +34,7 @@ class SuningRepositoryImpl extends SuningRepository {
/// [itemUrl] 待转链的苏宁商品链接 /// [itemUrl] 待转链的苏宁商品链接
/// ///
@override @override
Future<dynamic> suningActTurnChainLink({String itemUrl}) async { Future<dynamic> suningActTurnChainLink({String? itemUrl}) async {
Options options = Options(headers: {'interceptor': 'interceptor1'}); Options options = Options(headers: {'interceptor': 'interceptor1'});
dynamic result = await DSDioUtil.getInstance().post( dynamic result = await DSDioUtil.getInstance().post(
'turnchain.suningActLink', 'turnchain.suningActLink',
......
...@@ -6,7 +6,7 @@ class TencentRepositoryImpl extends TencentRepository { ...@@ -6,7 +6,7 @@ class TencentRepositoryImpl extends TencentRepository {
@override @override
Future<DSResponseList<MapPlaceEntity>> qryPlaceByCity( Future<DSResponseList<MapPlaceEntity>> qryPlaceByCity(
String key, String keyword, String key, String keyword,
{String region, int regionFix = 1, String output = 'json'}) async { {String? region, int regionFix = 1, String output = 'json'}) async {
Options options = Options(headers: {'base_url': 'TencentMap'}); Options options = Options(headers: {'base_url': 'TencentMap'});
dynamic result = dynamic result =
await DSDioUtil.getInstance().get('/ws/place/v1/suggestion', await DSDioUtil.getInstance().get('/ws/place/v1/suggestion',
......
...@@ -17,7 +17,7 @@ class UserRepositoryImpl extends UserRepository { ...@@ -17,7 +17,7 @@ class UserRepositoryImpl extends UserRepository {
); );
DSResponseObject object = DSResponseObject.fromJson( DSResponseObject object = DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
return object; return object;
} }
...@@ -32,7 +32,7 @@ class UserRepositoryImpl extends UserRepository { ...@@ -32,7 +32,7 @@ class UserRepositoryImpl extends UserRepository {
); );
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
...@@ -43,7 +43,7 @@ class UserRepositoryImpl extends UserRepository { ...@@ -43,7 +43,7 @@ class UserRepositoryImpl extends UserRepository {
); );
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
...@@ -57,7 +57,7 @@ class UserRepositoryImpl extends UserRepository { ...@@ -57,7 +57,7 @@ class UserRepositoryImpl extends UserRepository {
); );
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
...@@ -68,7 +68,7 @@ class UserRepositoryImpl extends UserRepository { ...@@ -68,7 +68,7 @@ class UserRepositoryImpl extends UserRepository {
); );
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
...@@ -79,7 +79,7 @@ class UserRepositoryImpl extends UserRepository { ...@@ -79,7 +79,7 @@ class UserRepositoryImpl extends UserRepository {
); );
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
...@@ -93,7 +93,7 @@ class UserRepositoryImpl extends UserRepository { ...@@ -93,7 +93,7 @@ class UserRepositoryImpl extends UserRepository {
); );
return DSResponseObject.fromJson( return DSResponseObject.fromJson(
result, result,
(data) => Map<String, dynamic>.from(data), (data) => Map<String, dynamic>.from(data!),
); );
} }
} }
import 'package:flutter/foundation.dart';
import 'package:base_repository/base_repository.dart'; import 'package:base_repository/base_repository.dart';
import 'package:xiaoxiong_repository/entity/product_details_entity.dart'; import 'package:xiaoxiong_repository/entity/product_details_entity.dart';
import 'package:xiaoxiong_repository/entity/product_item_entity.dart'; import 'package:xiaoxiong_repository/entity/product_item_entity.dart';
...@@ -27,17 +26,17 @@ abstract class PriceRepository { ...@@ -27,17 +26,17 @@ abstract class PriceRepository {
Future<DSResponseList<ProductItemEntity>> qryProductList( Future<DSResponseList<ProductItemEntity>> qryProductList(
{int page = 1, {int page = 1,
int pagesize = 10, int pagesize = 10,
String keywords, String? keywords,
String categoryId, String? categoryId,
String excludeId, String? excludeId,
List<dynamic> filters}); List<dynamic>? filters});
/// ///
/// 获取商品详情 /// 获取商品详情
/// [id] 商品详情Id /// [id] 商品详情Id
/// ///
Future<DSResponseObject<ProductDetailsEntity>> qryProductDetails( Future<DSResponseObject<ProductDetailsEntity>> qryProductDetails(
{@required String id}); {required String id});
/// ///
/// 好价推荐列表 /// 好价推荐列表
...@@ -47,8 +46,8 @@ abstract class PriceRepository { ...@@ -47,8 +46,8 @@ abstract class PriceRepository {
/// [pagesize] 当前页显示的大小 /// [pagesize] 当前页显示的大小
/// ///
Future<DSResponseList<ProductItemEntity>> getSellingRecommends({ Future<DSResponseList<ProductItemEntity>> getSellingRecommends({
String keywords, String? keywords,
String excludeId, String? excludeId,
int page = 1, int page = 1,
int pagesize = 10, int pagesize = 10,
}); });
...@@ -59,7 +58,7 @@ abstract class PriceRepository { ...@@ -59,7 +58,7 @@ abstract class PriceRepository {
/// [reportType] 举报类型 /// [reportType] 举报类型
/// ///
Future<DSResponseBool> report( Future<DSResponseBool> report(
{@required String id, @required String reportType}); {required String id, required String reportType});
/// ///
/// 点赞 /// 点赞
...@@ -69,7 +68,7 @@ abstract class PriceRepository { ...@@ -69,7 +68,7 @@ abstract class PriceRepository {
/// [platform] 平台 20好价 /// [platform] 平台 20好价
/// ///
Future<DSResponseBool> userLike( Future<DSResponseBool> userLike(
{@required String markId, {required String markId,
String type = '2', String type = '2',
String status = '1', String status = '1',
String platform = '20'}); String platform = '20'});
...@@ -82,7 +81,7 @@ abstract class PriceRepository { ...@@ -82,7 +81,7 @@ abstract class PriceRepository {
/// [status] 点赞状态1点赞 2取消点赞 /// [status] 点赞状态1点赞 2取消点赞
/// ///
Future<DSResponseBool> userCollect( Future<DSResponseBool> userCollect(
{@required String itemId, {required String itemId,
String type = '2', String type = '2',
String platform = '20', String platform = '20',
String status = '1'}); String status = '1'});
...@@ -94,8 +93,8 @@ abstract class PriceRepository { ...@@ -94,8 +93,8 @@ abstract class PriceRepository {
/// [type] 转链类型 好价传6 默认为5 /// [type] 转链类型 好价传6 默认为5
/// ///
Future<DSResponseObject<TurnChainEntity>> turnChainForItemId( Future<DSResponseObject<TurnChainEntity>> turnChainForItemId(
{@required String itemId, {required String itemId,
@required String platform, required String platform,
String type = '5', String type = '5',
String sellerId = ''}); String sellerId = ''});
} }
import 'package:base_repository/base_repository.dart'; import 'package:base_repository/base_repository.dart';
import 'package:flutter/material.dart';
import 'impl/product_repository_impl.dart'; import 'impl/product_repository_impl.dart';
/// ///
...@@ -20,7 +18,7 @@ abstract class ProductRepository { ...@@ -20,7 +18,7 @@ abstract class ProductRepository {
Future<DSResponseList> getNines({ Future<DSResponseList> getNines({
int page = 1, int page = 1,
int pagesize = 10, int pagesize = 10,
@required int type, required int type,
}); });
/// ///
...@@ -29,8 +27,8 @@ abstract class ProductRepository { ...@@ -29,8 +27,8 @@ abstract class ProductRepository {
/// [needUrl] 是否需要跳链 1需要 0不需要 /// [needUrl] 是否需要跳链 1需要 0不需要
/// ///
Future<DSResponseObject> qryGoFreeBuy({ Future<DSResponseObject> qryGoFreeBuy({
@required String id, required String id,
@required int needUrl, required int needUrl,
}); });
/// ///
...@@ -42,5 +40,5 @@ abstract class ProductRepository { ...@@ -42,5 +40,5 @@ abstract class ProductRepository {
/// 兑换免单商品结果 /// 兑换免单商品结果
/// [id] 数据id /// [id] 数据id
/// ///
Future<DSResponseObject> qryFreeProductResult({@required String id}); Future<DSResponseObject> qryFreeProductResult({required String id});
} }
import 'package:base_repository/base_repository.dart'; import 'package:base_repository/base_repository.dart';
import 'package:flutter/foundation.dart';
import 'package:xiaoxiong_repository/entity/suning_item_entity.dart'; import 'package:xiaoxiong_repository/entity/suning_item_entity.dart';
import 'impl/suning_repository_impl.dart'; import 'impl/suning_repository_impl.dart';
...@@ -25,5 +24,5 @@ abstract class SuningRepository { ...@@ -25,5 +24,5 @@ abstract class SuningRepository {
/// 苏宁活动转链 /// 苏宁活动转链
/// [itemUrl] 待转链的苏宁商品链接 /// [itemUrl] 待转链的苏宁商品链接
/// ///
Future<dynamic> suningActTurnChainLink({@required String itemUrl}); Future<dynamic> suningActTurnChainLink({required String itemUrl});
} }
import 'package:base_repository/base_repository.dart'; import 'package:base_repository/base_repository.dart';
import 'package:flutter/material.dart';
import 'package:xiaoxiong_repository/entity/map_place_entity.dart'; import 'package:xiaoxiong_repository/entity/map_place_entity.dart';
import 'impl/tencent_repository_impl.dart'; import 'impl/tencent_repository_impl.dart';
...@@ -22,5 +21,5 @@ abstract class TencentRepository { ...@@ -22,5 +21,5 @@ abstract class TencentRepository {
/// ///
Future<DSResponseList<MapPlaceEntity>> qryPlaceByCity( Future<DSResponseList<MapPlaceEntity>> qryPlaceByCity(
String key, String keyword, String key, String keyword,
{@required String region, int regionFix = 1, String output = 'json'}); {required String region, int regionFix = 1, String output = 'json'});
} }
...@@ -52,20 +52,13 @@ packages: ...@@ -52,20 +52,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0" version: "1.15.0"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
crypto: crypto:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: crypto name: crypto
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.4" version: "3.0.1"
dio: dio:
dependency: transitive dependency: transitive
description: description:
......
...@@ -4,7 +4,7 @@ version: 1.0.0 ...@@ -4,7 +4,7 @@ version: 1.0.0
homepage: homepage:
publish_to: none publish_to: none
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: '>=2.12.0 <3.0.0'
flutter: ">=1.17.0 <2.0.0" flutter: ">=1.17.0 <2.0.0"
dependencies: dependencies:
...@@ -18,4 +18,4 @@ dependencies: ...@@ -18,4 +18,4 @@ dependencies:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
crypto: 2.1.4 crypto: ^3.0.1
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment