Browse Source

更新布局更改;

zyh
w-R 3 years ago
parent
commit
f7238a85f1
  1. 3
      lib/main_page.dart
  2. 2
      lib/utils/flutter_utils.dart
  3. 56
      lib/view_widget/update_dialog.dart
  4. 2
      pubspec.yaml

3
lib/main_page.dart

@ -129,6 +129,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
UnionPage(unionPageKey,0),
// (Theme.of(context).platform == TargetPlatform.android) ? OrderPage() :CommunityPage(),
CommunityPage(),
// OrderPage(),
MinePage(minePageKey),
];
@ -353,7 +354,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
BaseData<AppUpdate> baseData = await apiService.appVersion().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
// baseData.data.appLastVersion = "1.0.4";
// baseData.data.appLastVersion = "2.0.11";
// baseData.data.appLastVersionUp = "1.0.1";
if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion)
&& AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){

2
lib/utils/flutter_utils.dart

@ -26,7 +26,7 @@ class AppUtils {
return false;
if (int.tryParse(localVersionArr[1]) > int.tryParse(serverVersionArr[1]))
return false;
if (int.tryParse(localVersionArr[2]) > int.tryParse(serverVersionArr[2]))
if (int.tryParse(localVersionArr[2]) >= int.tryParse(serverVersionArr[2]))
return false;
} catch (ex) {}
return true;

56
lib/view_widget/update_dialog.dart

@ -30,46 +30,48 @@ class _UpdateDialog extends State<UpdateDialog> {
child: Center(
child: Container(
width: MediaQuery.of(context).size.width - 80.w,
height: 165.h,
// height: 216.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.r),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: double.infinity,
// height: 110.h,
alignment: Alignment.center,
padding: EdgeInsets.all(20),
child: Column(
children: [
Text(
"检测到新版本 v${widget.appUpdate.appLastVersion}",
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000),
width: double.infinity,
// height: 110.h,
alignment: Alignment.center,
padding: EdgeInsets.all(20),
child: Column(
children: [
Text(
"发现新版本 v${widget.appUpdate.appLastVersion}",
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000),
),
),
),
SizedBox(height: 12.h,),
Text(
"是否需要更新到最新版本?",
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF333333),
SizedBox(height: 12.h,),
Text(
widget.appUpdate.appLastVersionExplain ?? "",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF333333),
),
),
),
],
)
],
)
),
Container(
color: Color(0x1A000000),
height: 1.h,
),
Container(
height: 69.h,
height:55.h,
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
@ -81,7 +83,7 @@ class _UpdateDialog extends State<UpdateDialog> {
},
child: Container(
width: double.infinity,
height: 90.h,
// height: 90.h,
alignment: Alignment.center,
child: Text(
"下次再说",
@ -107,7 +109,7 @@ class _UpdateDialog extends State<UpdateDialog> {
},
child: Container(
width: double.infinity,
height: 90.h,
// height: 90.h,
alignment: Alignment.center,
child: Text(
"立即更新",

2
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 2.0.12+9
version: 2.0.14+9
environment:
sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save