Browse Source

UI

null_safety
fmk 3 years ago
parent
commit
ea61f5c534
  1. 21
      android/app/build.gradle
  2. BIN
      android/app/libs/armeabi/libAMapSDK_MAP_v7_9_1.so
  3. 1
      android/build.gradle
  4. 1
      lib/main.dart
  5. 26
      lib/main_page.dart
  6. 10
      lib/mine/mine_page.dart
  7. 2
      lib/mine/mine_vip_level_page.dart
  8. 29
      lib/union/store_details_page.dart
  9. 28
      lib/union/union_page.dart
  10. 8
      lib/view_widget/hot_item.dart
  11. 2
      lib/view_widget/mine_vip_view.dart
  12. 4
      pubspec.yaml

21
android/app/build.gradle

@ -111,9 +111,10 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
ndk {
/// .so
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
manifestPlaceholders = mfph
@ -141,21 +142,14 @@ android {
buildTypes {
release {
debuggable true
// debuggable true
shrinkResources false
minifyEnabled false
signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
shrinkResources false
minifyEnabled false
signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
profile {
debuggable true
// debuggable true
shrinkResources false
minifyEnabled false
signingConfig signingConfigs.config
@ -163,6 +157,13 @@ android {
}
}
packagingOptions {
exclude 'assets/cfg/a/DVDirectory.cfg'
exclude 'assets/cfg/a/DVHotcity.cfg'
exclude 'assets/main_icon_zoomin.png'
exclude 'assets/cfg/a/mode_1/reduct.sty'
exclude 'assets/SDK_Default_Traffic_Texture_SevereCongestion.png'
}
aaptOptions {
additionalParameters '--auto-add-overlay'
ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"

BIN
android/app/libs/armeabi/libAMapSDK_MAP_v7_9_1.so

Binary file not shown.

1
android/build.gradle

@ -23,6 +23,7 @@ buildscript {
}
dependencies {
// classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.huawei.agconnect:agcp:1.4.1.300'

1
lib/main.dart

@ -53,7 +53,6 @@ import 'package:huixiang/union/store_details_page.dart';
import 'package:huixiang/union/union_details_page.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/utils/bridge.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart';

26
lib/main_page.dart

@ -89,13 +89,13 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
if (Platform.isAndroid) {
xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler(
MyNativeEventHandler((String title, String message,
String customContent, int type) {
print("xgPushClickAction2: $customContent");
SharedPreferences.getInstance().then((value) {
value.setString("pushData", customContent);
});
}));
MyNativeEventHandler(
(String title, String message, String customContent, int type) {
print("xgPushClickAction2: $customContent");
SharedPreferences.getInstance().then((value) {
value.setString("pushData", customContent);
});
}));
}
/// @typed: 1 2 3 4 5
@ -117,7 +117,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
ModalRoute.of(context).isCurrent) {
pushRoute();
} else {
Navigator.of(context).pushNamedAndRemoveUntil('/router/main_page', (route) => false);
Navigator.of(context)
.pushNamedAndRemoveUntil('/router/main_page', (route) => false);
}
}
return event;
@ -290,9 +291,10 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
Text(
text,
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.bold,
color: Color(0xFF4C4C4C)),
fontSize: 10,
fontWeight: FontWeight.bold,
color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E),
),
),
],
),
@ -355,7 +357,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF4C4C4C),
color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E),
),
),
],

10
lib/mine/mine_page.dart

@ -157,7 +157,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
Column(
children: [
Container(
margin: EdgeInsets.only(bottom: 12.h, right: 16.w),
margin: EdgeInsets.only(right: 16.w),
alignment: Alignment.centerRight,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
@ -316,11 +316,11 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
///
Widget mineList(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 28.h),
margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 28.h),
padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8)),
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
@ -455,11 +455,11 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
///
Widget orderOrCard() {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 8.h),
margin: EdgeInsets.fromLTRB(16.w, 12.h, 16.w, 10.h),
padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8)),
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),

2
lib/mine/mine_vip_level_page.dart

@ -70,7 +70,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
child: Column(
children: [
AspectRatio(
aspectRatio: 1.7,
aspectRatio: 1.6,
child: Swiper(
viewportFraction: 0.95,
loop: false,

29
lib/union/store_details_page.dart

@ -16,6 +16,7 @@ import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/like_widget.dart';
import 'package:huixiang/view_widget/login_tips.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/share_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -192,6 +193,23 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
//
queryCommentLike(String id) async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
String token = sharedPreferences.getString("token");
if (token == null || token == "") {
SmartDialog.show(
widget: LoginTips(
click: () {
SharedPreferences.getInstance()
.then((value) => value..setString("token", ""));
Navigator.of(context)
.pushNamed('/router/login_page', arguments: {"login": "login"});
},
),
clickBgDismissTemp: false,
);
return;
}
BaseData baseData =
await apiService.commentLike(id).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
@ -420,10 +438,11 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0)
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
@ -708,7 +727,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage>
// height: 16,
// ),
// ),
LikeWidget(isLiked, (isLike) {
LikeWidget(memberList.liked ?? false, (isLike) {
if (memberList.liked ?? false) return;
queryCommentLike(memberList.id);
}),

28
lib/union/union_page.dart

@ -38,7 +38,6 @@ class UnionPage extends StatefulWidget {
class _UnionPage extends State<UnionPage>
with AutomaticKeepAliveClientMixin, WidgetsBindingObserver {
LocationFlutterPlugin aMapFlutterLocation;
RefreshController refreshController =
RefreshController(initialRefresh: false);
@ -95,9 +94,10 @@ class _UnionPage extends State<UnionPage>
latLng = BMFCoordinate(event["latitude"], event["longitude"]);
}
BMFCalculateUtils.coordConvert(
coordinate: latLng,
fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL).then((value) {
coordinate: latLng,
fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL)
.then((value) {
this.latLng = value;
saveLatLng(
value, event["province"], event["city"], event["district"]);
@ -155,12 +155,9 @@ class _UnionPage extends State<UnionPage>
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}");
await prefs.setString("longitude", "${latLng.longitude}");
if (province != null)
await prefs.setString("province", province);
if (city != null)
await prefs.setString("city", city);
if (district != null)
await prefs.setString("district", district);
if (province != null) await prefs.setString("province", province);
if (city != null) await prefs.setString("city", city);
if (district != null) await prefs.setString("district", district);
}
getLatLng() async {
@ -360,7 +357,9 @@ class _UnionPage extends State<UnionPage>
requestDialog();
refreshController.refreshCompleted();
} else if (await Permission.location.isGranted) {
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1));
SmartDialog.showLoading(
msg: S.of(context).zhengzaijiazai,
animationDurationTemp: Duration(seconds: 1));
aMapFlutterLocation.startLocation();
Future.delayed(Duration(seconds: 6), () {
SmartDialog.dismiss();
@ -663,12 +662,17 @@ class _UnionPage extends State<UnionPage>
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 2.w,
),
Image.asset(
"assets/image/icon_union_location_black.png",
width: 14.w,
height: 14.h,
),
SizedBox(width: 2.w,),
SizedBox(
width: 2.w,
),
Expanded(
flex: 1,
child: Text(

8
lib/view_widget/hot_item.dart

@ -185,7 +185,7 @@ class _HotArticleItem extends State<HotArticleItem> {
),
),
SizedBox(
width: 5.w,
width: 12.w,
),
Container(
alignment: Alignment.topRight,
@ -208,9 +208,9 @@ class _HotArticleItem extends State<HotArticleItem> {
],
),
),
// SizedBox(
// width: 5.w,
// ),
SizedBox(
width: 12.w,
),
Container(
alignment: Alignment.topRight,
child: Row(

2
lib/view_widget/mine_vip_view.dart

@ -93,7 +93,7 @@ class MineVipView extends StatelessWidget {
}
}
return AspectRatio(
aspectRatio: 1.7,
aspectRatio: 1.6,
child: Container(
margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h),
decoration: BoxDecoration(

4
pubspec.yaml

@ -34,11 +34,11 @@ dependencies:
git:
url: git://github.com/TencentCloud/TPNS-Flutter-Plugin
ref: V1.1.2
# tpns_flutter_plugin: ^1.1.0
# tpns_flutter_plugin: ^1.1.0
barcode_widget: ^2.0.1
cupertino_icons: ^1.0.2
# flutter_swiper_null_safety: ^1.0.2
# flutter_swiper_null_safety: ^1.0.2
flutter_swiper: ^1.1.6
flutter_staggered_grid_view: ^0.4.0 # Null safety
pull_to_refresh: ^2.0.0 # Null safety

Loading…
Cancel
Save