import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:get/get.dart'; import 'package:sk_base_mobile/app_theme.dart'; import 'package:sk_base_mobile/services/app_info.service.dart'; import 'package:sk_base_mobile/util/screen_adaper_util.dart'; import 'package:sk_base_mobile/widgets/gradient_button.dart'; class UpgradeConfirm extends StatelessWidget { void Function()? onConfirm; bool forceUpgrade; UpgradeConfirm({super.key, this.onConfirm, this.forceUpgrade = true}); @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(ScreenAdaper.radius(30))), margin: EdgeInsets.only(bottom: ScreenAdaper.height(30)), alignment: Alignment.center, child: Stack( children: [ Container( height: ScreenAdaper.height(600), constraints: BoxConstraints(maxHeight: ScreenAdaper.height(600)), width: ScreenAdaper.width(800), margin: EdgeInsets.only( top: ScreenAdaper.height(100), ), padding: EdgeInsets.only( top: ScreenAdaper.height(50), bottom: ScreenAdaper.height(30)), decoration: BoxDecoration( color: AppTheme.nearlyWhite, borderRadius: BorderRadius.circular(ScreenAdaper.radius(30))), child: Column( children: [ Text( '有新的版本更新啦', style: TextStyle( decoration: TextDecoration.none, fontSize: ScreenAdaper.height(35), color: AppTheme.nearlyBlack, ), ), SizedBox( height: ScreenAdaper.height(30), ), Expanded( child: SingleChildScrollView( child: Column( children: [ Text('1.修复bug', style: TextStyle( decoration: TextDecoration.none, fontSize: ScreenAdaper.height(30), color: AppTheme.grey, fontWeight: FontWeight.w400)), Text('2.优化体验', style: TextStyle( decoration: TextDecoration.none, fontSize: ScreenAdaper.height(30), color: AppTheme.grey, fontWeight: FontWeight.w400)), ], ))), SizedBox( height: ScreenAdaper.height(30), ), Container( width: ScreenAdaper.height(400), child: GradientButton( buttonText: '去更新', onPressed: () { if (onConfirm != null) onConfirm!(); }, ), ) ], ), ), if (!forceUpgrade) Positioned( right: 0, top: ScreenAdaper.height(100), child: // 更新内容 IconButton( onPressed: () { Get.back(); }, icon: const Icon(Icons.close)), ), // 悬浮图标 Positioned( left: 0, right: 0, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Image( image: const AssetImage('assets/images/rocket.png'), height: ScreenAdaper.height(150), ) ], ), ), ], ), ); } }