This commit is contained in:
DESKTOP-I3JPKHK\wy 2025-09-18 10:26:04 +08:00
parent 2f0cd3ef37
commit 36680ec187
1 changed files with 27 additions and 24 deletions

View File

@ -1,6 +1,5 @@
import 'dart:io';
import 'package:app_upgrade_plugin/widgets/market_selection_dialog.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
@ -413,6 +412,8 @@ mixin _UpgradeDialogLogic<T extends StatefulWidget> on State<T> {
context: context,
isScrollControlled: false,
useRootNavigator: true,
isDismissible: !info.isForceUpdate, //
enableDrag: !info.isForceUpdate, //
// UI Beautification: Rounded corners
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
@ -434,20 +435,21 @@ mixin _UpgradeDialogLogic<T extends StatefulWidget> on State<T> {
borderRadius: BorderRadius.circular(2),
),
),
// Title and Close Button
// Title and Close Button -
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Stack(
alignment: Alignment.center,
children: [
const Text('选择更新方式', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
Positioned(
right: -12,
child: IconButton(
icon: const Icon(Icons.close),
onPressed: () => Navigator.of(ctx).pop(),
if (!info.isForceUpdate)
Positioned(
right: -12,
child: IconButton(
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),
// Cancel Button
SizedBox(
width: double.infinity,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 12),
backgroundColor: Colors.white,
foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,
elevation: 2,
shadowColor: Colors.grey.withOpacity(0.5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: BorderSide(color: Colors.grey.shade300),
// Cancel Button -
if (!info.isForceUpdate)
SizedBox(
width: double.infinity,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 12),
backgroundColor: Colors.white,
foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,
elevation: 2,
shadowColor: Colors.grey.withOpacity(0.5),
shape: RoundedRectangleBorder(
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)),
),
),
],
),
),