111
This commit is contained in:
parent
2f0cd3ef37
commit
36680ec187
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:app_upgrade_plugin/widgets/market_selection_dialog.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
|
||||||
|
|
@ -413,6 +412,8 @@ mixin _UpgradeDialogLogic<T extends StatefulWidget> on State<T> {
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: false,
|
isScrollControlled: false,
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
|
isDismissible: !info.isForceUpdate, // 强制更新时不允许通过手势关闭
|
||||||
|
enableDrag: !info.isForceUpdate, // 强制更新时不允许拖拽关闭
|
||||||
// UI Beautification: Rounded corners
|
// UI Beautification: Rounded corners
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
||||||
|
|
@ -434,20 +435,21 @@ mixin _UpgradeDialogLogic<T extends StatefulWidget> on State<T> {
|
||||||
borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Title and Close Button
|
// Title and Close Button - 强制更新时不显示关闭按钮
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 8.0),
|
padding: const EdgeInsets.only(bottom: 8.0),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Text('选择更新方式', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
|
const Text('选择更新方式', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
|
||||||
Positioned(
|
if (!info.isForceUpdate)
|
||||||
right: -12,
|
Positioned(
|
||||||
child: IconButton(
|
right: -12,
|
||||||
icon: const Icon(Icons.close),
|
child: IconButton(
|
||||||
onPressed: () => Navigator.of(ctx).pop(),
|
icon: const Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(ctx).pop(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -470,25 +472,26 @@ mixin _UpgradeDialogLogic<T extends StatefulWidget> on State<T> {
|
||||||
|
|
||||||
const Divider(height: 24),
|
const Divider(height: 24),
|
||||||
|
|
||||||
// Cancel Button
|
// Cancel Button - 强制更新时不显示取消按钮
|
||||||
SizedBox(
|
if (!info.isForceUpdate)
|
||||||
width: double.infinity,
|
SizedBox(
|
||||||
child: ElevatedButton(
|
width: double.infinity,
|
||||||
style: ElevatedButton.styleFrom(
|
child: ElevatedButton(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Colors.white,
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,
|
backgroundColor: Colors.white,
|
||||||
elevation: 2,
|
foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,
|
||||||
shadowColor: Colors.grey.withOpacity(0.5),
|
elevation: 2,
|
||||||
shape: RoundedRectangleBorder(
|
shadowColor: Colors.grey.withOpacity(0.5),
|
||||||
borderRadius: BorderRadius.circular(12),
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Colors.grey.shade300),
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
side: BorderSide(color: Colors.grey.shade300),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
onPressed: () => Navigator.of(ctx).pop(),
|
||||||
|
child: const Text('取消', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500)),
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(ctx).pop(),
|
|
||||||
child: const Text('取消', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500)),
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue