Browse Source

修改

null_safety
哈哈哈 4 years ago
parent
commit
2bd9a1aefe
  1. 12
      ios/Runner.xcodeproj/project.pbxproj
  2. 2
      ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  3. 4
      lib/home/points_mall_page.dart
  4. 34
      lib/login/login_page.dart
  5. 1
      lib/main.dart
  6. 7
      lib/order/order_detail_page.dart
  7. 14
      lib/order/write_off_page.dart
  8. 82
      lib/retrofit/data/activity.dart
  9. 12
      lib/retrofit/data/article.dart
  10. 4
      lib/union/store_details_page.dart
  11. 17
      lib/view_widget/custom_image.dart
  12. 3
      lib/view_widget/mine_vip_view.dart
  13. 21
      lib/view_widget/no_data_view.dart

12
ios/Runner.xcodeproj/project.pbxproj

@ -846,7 +846,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 31; CURRENT_PROJECT_VERSION = 32;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -881,7 +881,7 @@
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs", "$(PROJECT_DIR)/wx/Libs",
); );
MARKETING_VERSION = 1.0.3; MARKETING_VERSION = 1.0.32;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -1047,7 +1047,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 31; CURRENT_PROJECT_VERSION = 32;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -1082,7 +1082,7 @@
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs", "$(PROJECT_DIR)/wx/Libs",
); );
MARKETING_VERSION = 1.0.3; MARKETING_VERSION = 1.0.32;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -1140,7 +1140,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 31; CURRENT_PROJECT_VERSION = 32;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -1175,7 +1175,7 @@
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs", "$(PROJECT_DIR)/wx/Libs",
); );
MARKETING_VERSION = 1.0.3; MARKETING_VERSION = 1.0.32;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",

2
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

@ -81,7 +81,7 @@
buildConfiguration = "Debug"> buildConfiguration = "Debug">
</AnalyzeAction> </AnalyzeAction>
<ArchiveAction <ArchiveAction
buildConfiguration = "Debug" buildConfiguration = "Release"
revealArchiveInOrganizer = "YES"> revealArchiveInOrganizer = "YES">
</ArchiveAction> </ArchiveAction>
</Scheme> </Scheme>

4
lib/home/points_mall_page.dart

@ -440,8 +440,8 @@ class _PointsMallPage extends State<PointsMallPage>
borderRadius: BorderRadius.only(topRight: Radius.circular(4)), borderRadius: BorderRadius.only(topRight: Radius.circular(4)),
child: Image.asset( child: Image.asset(
"assets/image/icon_hot_right_top.png", "assets/image/icon_hot_right_top.png",
width: 36.w, width: 36,
height: 36.h, height: 36,
), ),
), ),
), ),

34
lib/login/login_page.dart

@ -559,7 +559,10 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
child: Text( child: Text(
S.of(context).login, S.of(context).login,
style: TextStyle(fontSize: 18.sp,fontWeight: FontWeight.w400, color: Colors.white), style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w400,
color: Colors.white),
), ),
), ),
), ),
@ -918,7 +921,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
elevation: 0, elevation: 0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(6))), borderRadius: BorderRadius.circular(6),
),
children: <Widget>[ children: <Widget>[
Stack( Stack(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
@ -927,11 +931,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
alignment: Alignment.center, alignment: Alignment.center,
width: double.infinity, width: double.infinity,
height: 305.h, height: 305.h,
// margin: EdgeInsets.only(left: 40.w, right: 40.w),
padding: EdgeInsets.only(left: 16.w, right: 16.w), padding: EdgeInsets.only(left: 16.w, right: 16.w),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8))), borderRadius: BorderRadius.circular(8),
),
child: Column( child: Column(
children: [ children: [
Padding( Padding(
@ -950,10 +954,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
TextSpan( TextSpan(
text: S.of(context).yinsizhengce1, text: S.of(context).yinsizhengce1,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14.sp, fontSize: 14.sp,
height: 1.3.h, height: 1.3.h,
color: Color(0xff727272)), color: Color(0xff727272),
),
), ),
TextSpan( TextSpan(
text: S.of(context).yinsixieyi, text: S.of(context).yinsixieyi,
@ -993,7 +998,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
// Navigator.of(context).pop(); exit(0);
}, },
child: Container( child: Container(
height: 40.h, height: 40.h,
@ -1001,7 +1006,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
margin: EdgeInsets.only(bottom: 20.h), margin: EdgeInsets.only(bottom: 20.h),
child: BorderText( child: BorderText(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10.h, bottom: 10.h, left: 36.w, right: 36.w), top: 10.h,
bottom: 10.h,
left: 36.w,
right: 36.w,
),
text: S.of(context).jujue, text: S.of(context).jujue,
fontSize: 12.sp, fontSize: 12.sp,
textColor: Color(0xFF32A060), textColor: Color(0xFF32A060),
@ -1027,7 +1036,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
value.setBool("isShowPrivacyPolicy", true); value.setBool("isShowPrivacyPolicy", true);
}); });
SharesdkPlugin.uploadPrivacyPermissionStatus( SharesdkPlugin.uploadPrivacyPermissionStatus(
1, (success) => { 1,
(success) => {
Navigator.of(context).pop(), Navigator.of(context).pop(),
}, },
); );

1
lib/main.dart

@ -108,7 +108,6 @@ initSdk() async {
} }
ShareSDKRegister shareSDKRegister = ShareSDKRegister(); ShareSDKRegister shareSDKRegister = ShareSDKRegister();
// shareSDKRegister.setup
shareSDKRegister.setupWechat("wx3b269e795ed23e5f", shareSDKRegister.setupWechat("wx3b269e795ed23e5f",
"64020361b8ec4c99936c0e3999a9f249", "https://hx.lotus-wallet.com/app/"); "64020361b8ec4c99936c0e3999a9f249", "https://hx.lotus-wallet.com/app/");
shareSDKRegister.setupFacebook( shareSDKRegister.setupFacebook(

7
lib/order/order_detail_page.dart

@ -79,10 +79,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
titleColor: Colors.white, titleColor: Colors.white,
background: Color(0xFF3A405A), background: Color(0xFF3A405A),
leadingColor: Colors.white, leadingColor: Colors.white,
toolbarHeight: (orderStatus >= 4 ? 98 : 108) + MediaQuery.of(context).padding.top + kToolbarHeight,
bottom: PreferredSize( bottom: PreferredSize(
preferredSize: Size(double.infinity, orderStatus >= 4 ? 98.h : 108.h), preferredSize: Size(double.infinity, orderStatus >= 4 ? 98 : 108),
child: Container( child: Container(
height: orderStatus >= 4 ? 98.h : 108.h, height: orderStatus >= 4 ? 98 : 108,
padding: EdgeInsets.fromLTRB(16.w, 0, 16.w, 10.h), padding: EdgeInsets.fromLTRB(16.w, 0, 16.w, 10.h),
child: Column( child: Column(
children: [ children: [
@ -172,7 +173,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
left: 0, left: 0,
right: 0, right: 0,
child: Container( child: Container(
height: 36.h, height: 36,
color: Color(0xFF3A405A), color: Color(0xFF3A405A),
), ),
), ),

14
lib/order/write_off_page.dart

@ -5,7 +5,7 @@ import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/separator.dart'; import 'package:huixiang/view_widget/separator.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
// import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
class WriteOffPage extends StatefulWidget { class WriteOffPage extends StatefulWidget {
final arguments; final arguments;
@ -137,12 +137,12 @@ class _WriteOffPage extends State<WriteOffPage> {
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
// QrImage( QrImage(
// data: coupon != null ? coupon.id : "", data: coupon != null ? coupon.id : "",
// version: QrVersions.auto, version: QrVersions.auto,
// size: 200.w, size: 200.w,
// gapless: true, gapless: true,
// ), ),
SizedBox( SizedBox(
height: 35.h, height: 35.h,
), ),

82
lib/retrofit/data/activity.dart

@ -1,6 +1,4 @@
class Activity { class Activity {
Activity(); Activity();
String id; String id;
@ -17,6 +15,8 @@ class Activity {
String endTime; String endTime;
int state; int state;
int isDelete; int isDelete;
int likes;
int viewers;
String storeName; String storeName;
factory Activity.fromJson(Map<String, dynamic> json) => Activity() factory Activity.fromJson(Map<String, dynamic> json) => Activity()
@ -34,62 +34,28 @@ class Activity {
..endTime = json['endTime'] ..endTime = json['endTime']
..state = json['state'] ..state = json['state']
..isDelete = json['isDelete'] ..isDelete = json['isDelete']
..likes = json["likes"]
..viewers = json["viewers"]
..storeName = json['storeName']; ..storeName = json['storeName'];
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
'id': this.id, 'id': this.id,
'createTime': this.createTime, 'createTime': this.createTime,
'createUser': this.createUser, 'createUser': this.createUser,
'updateTime': this.updateTime, 'updateTime': this.updateTime,
'updateUser': this.updateUser, 'updateUser': this.updateUser,
'storeId': this.storeId, 'storeId': this.storeId,
'mainTitle': this.mainTitle, 'mainTitle': this.mainTitle,
'viceTitle': this.viceTitle, 'viceTitle': this.viceTitle,
'content': this.content, 'content': this.content,
'coverImg': this.coverImg, 'coverImg': this.coverImg,
'startTime': this.startTime, 'startTime': this.startTime,
'endTime': this.endTime, 'endTime': this.endTime,
'state': this.state, 'state': this.state,
'isDelete': this.isDelete, 'isDelete': this.isDelete,
'storeName': this.storeName, 'likes': this.likes,
}; 'viewers': this.viewers,
'storeName': this.storeName
// Activity _$ActivityFromJson(Map<String, dynamic> json) { };
// return Activity()
// ..id = json['id'] as String }
// ..createTime = json['createTime'] as String
// ..createUser = json['createUser']
// ..updateTime = json['updateTime'] as String
// ..updateUser = json['updateUser']
// ..storeId = json['storeId'] as String
// ..mainTitle = json['mainTitle'] as String
// ..viceTitle = json['viceTitle'] as String
// ..content = json['content'] as String
// ..coverImg = json['coverImg'] as String
// ..startTime = json['startTime'] as String
// ..endTime = json['endTime'] as String
// ..state = json['state'] as int
// ..isDelete = json['isDelete'] as int
// ..storeName = json['storeName'] as String;
// }
// Map<String, dynamic> _$ActivityToJson(Activity instance) => <String, dynamic>{
// 'id': instance.id,
// 'createTime': instance.createTime,
// 'createUser': instance.createUser,
// 'updateTime': instance.updateTime,
// 'updateUser': instance.updateUser,
// 'storeId': instance.storeId,
// 'mainTitle': instance.mainTitle,
// 'viceTitle': instance.viceTitle,
// 'content': instance.content,
// 'coverImg': instance.coverImg,
// 'startTime': instance.startTime,
// 'endTime': instance.endTime,
// 'state': instance.state,
// 'isDelete': instance.isDelete,
// 'storeName': instance.storeName,
// };
}

12
lib/retrofit/data/article.dart

@ -37,6 +37,8 @@ class Article {
String _endTime; String _endTime;
int _state; int _state;
int _isDelete; int _isDelete;
int _likes;
int _viewers;
dynamic _storeName; dynamic _storeName;
String get id => _id; String get id => _id;
@ -55,6 +57,8 @@ class Article {
String get endTime => _endTime; String get endTime => _endTime;
int get state => _state; int get state => _state;
int get isDelete => _isDelete; int get isDelete => _isDelete;
int get likes => _likes;
int get viewers => _viewers;
dynamic get storeName => _storeName; dynamic get storeName => _storeName;
Article({ Article({
@ -74,6 +78,8 @@ class Article {
String endTime, String endTime,
int state, int state,
int isDelete, int isDelete,
int likes,
int viewers,
dynamic storeName}){ dynamic storeName}){
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
@ -91,6 +97,8 @@ class Article {
_endTime = endTime; _endTime = endTime;
_state = state; _state = state;
_isDelete = isDelete; _isDelete = isDelete;
_likes = likes;
_viewers = viewers;
_storeName = storeName; _storeName = storeName;
} }
@ -111,6 +119,8 @@ class Article {
_endTime = json["endTime"]; _endTime = json["endTime"];
_state = json["state"]; _state = json["state"];
_isDelete = json["isDelete"]; _isDelete = json["isDelete"];
_likes = json["likes"];
_viewers = json["viewers"];
_storeName = json["storeName"]; _storeName = json["storeName"];
} }
@ -132,6 +142,8 @@ class Article {
map["endTime"] = _endTime; map["endTime"] = _endTime;
map["state"] = _state; map["state"] = _state;
map["isDelete"] = _isDelete; map["isDelete"] = _isDelete;
map["likes"] = _likes;
map["viewers"] = _viewers;
map["storeName"] = _storeName; map["storeName"] = _storeName;
return map; return map;
} }

4
lib/union/store_details_page.dart

@ -17,10 +17,8 @@ import 'package:sharesdk_plugin/sharesdk_interface.dart';
import 'package:sharesdk_plugin/sharesdk_map.dart'; import 'package:sharesdk_plugin/sharesdk_map.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter/webview_flutter.dart';
// ignore: implementation_imports
import 'package:flutter_html/src/replaced_element.dart'; import 'package:flutter_html/src/replaced_element.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
// ignore: implementation_imports
import 'package:chewie/src/chewie_progress_colors.dart' as chewie; import 'package:chewie/src/chewie_progress_colors.dart' as chewie;
import 'package:chewie/chewie.dart'; import 'package:chewie/chewie.dart';
@ -201,7 +199,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
}, },
), ),
SizedBox( SizedBox(
width: 10, width: 10.w,
), ),
Text( Text(
activity != null activity != null

17
lib/view_widget/custom_image.dart

@ -13,8 +13,7 @@ class MImage extends StatelessWidget {
final BoxFit fit; final BoxFit fit;
final bool isCircle; final bool isCircle;
MImage( MImage(this.src, {
this.src, {
this.errorSrc = "assets/image/default_2_1.png", this.errorSrc = "assets/image/default_2_1.png",
this.fadeSrc = "assets/image/default_2_1.png", this.fadeSrc = "assets/image/default_2_1.png",
this.aspectRatio, this.aspectRatio,
@ -28,7 +27,12 @@ class MImage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget image = LayoutBuilder(builder: (context, constraints) { Widget image = LayoutBuilder(builder: (context, constraints) {
String imageUrl = "$src?imageMogr2/thumbnail/${constraints.constrainWidth() * 2}x${constraints.constrainHeight() * 2}/format/webp/blur/1x0/quality/75"; String imageUrl = "";
if (src != null && src != "") {
imageUrl = "$src?imageMogr2/thumbnail/${constraints.constrainWidth() *
2}x${constraints.constrainHeight() *
2}/format/webp/blur/1x0/quality/75";
}
print("imageUrl: $imageUrl"); print("imageUrl: $imageUrl");
return CachedNetworkImage( return CachedNetworkImage(
imageUrl: imageUrl, imageUrl: imageUrl,
@ -48,7 +52,6 @@ class MImage extends StatelessWidget {
); );
}, },
placeholder: (context, placeholder) { placeholder: (context, placeholder) {
print("object $placeholder");
return Image.asset( return Image.asset(
fadeSrc, fadeSrc,
fit: fit, fit: fit,
@ -57,11 +60,11 @@ class MImage extends StatelessWidget {
); );
}); });
var clipRRect ; var clipRRect;
if (isCircle) { if (isCircle) {
clipRRect = ClipOval( clipRRect = ClipOval(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: image child: image
); );
} else { } else {
clipRRect = ClipRRect( clipRRect = ClipRRect(

3
lib/view_widget/mine_vip_view.dart

@ -114,6 +114,7 @@ class MineVipView extends StatelessWidget {
], ],
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -169,7 +170,7 @@ class MineVipView extends StatelessWidget {
], ],
), ),
Container( Container(
margin: EdgeInsets.only(left: 13.w, right: 12.w), margin: EdgeInsets.only(left: 13.w, right: 12.w, bottom:12.h),
child: Column( child: Column(
children: [ children: [
Row( Row(

21
lib/view_widget/no_data_view.dart

@ -1,13 +1,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class NoDataView extends StatelessWidget { class NoDataView extends StatelessWidget {
final bool isShowBtn; final bool isShowBtn;
final String text; final String text;
final double fontSize; final double fontSize;
final EdgeInsets margin; final EdgeInsets margin;
NoDataView( NoDataView(
{this.isShowBtn = true, this.text, {this.isShowBtn = true,
this.text,
this.fontSize, this.fontSize,
this.margin = const EdgeInsets.only(top: 30)}); this.margin = const EdgeInsets.only(top: 30)});
@ -20,24 +23,26 @@ class NoDataView extends StatelessWidget {
children: [ children: [
Image(image: AssetImage("assets/image/icon_empty.png")), Image(image: AssetImage("assets/image/icon_empty.png")),
SizedBox( SizedBox(
height: 35, height: 35.h,
), ),
Text( Text(
text, text,
style: TextStyle(fontSize: fontSize, color: Color(0xFF353535)), style: TextStyle(
fontSize: fontSize,
color: Color(0xFF353535),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10.h,
), ),
if (isShowBtn) if (isShowBtn)
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16), margin: EdgeInsets.symmetric(horizontal: 16.w),
child: RoundButton( child: RoundButton(
text: "返回首页", text: "返回首页",
textColor: Colors.white, textColor: Colors.white,
fontSize: 14, fontSize: 14.sp,
padding: padding: EdgeInsets.all(12.w),
EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
radius: 4, radius: 4,
), ),

Loading…
Cancel
Save