fix: 增加防丢图片修改
This commit is contained in:
@@ -2,10 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/hi_base_scaffold.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:kaer_with_panels/app/widgets/kr_local_image.dart';
|
||||
import 'package:kaer_with_panels/app/modules/hi_anti_lost/controllers/hi_anti_lost_controller.dart';
|
||||
import 'package:kaer_with_panels/app/modules/hi_anti_lost/widgets/hi_anti_lost_share_card.dart';
|
||||
|
||||
class HIAntiLostView extends GetView<HIAntiLostController> {
|
||||
const HIAntiLostView({super.key});
|
||||
@@ -18,70 +16,19 @@ class HIAntiLostView extends GetView<HIAntiLostController> {
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.symmetric(horizontal: 40.w),
|
||||
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 0.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black,
|
||||
borderRadius: BorderRadius.circular(25.r),
|
||||
border: Border.all(
|
||||
color: Theme.of(context).primaryColor, width: 4),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'保存二维码,防止失联',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryColor,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 25.w),
|
||||
Text(
|
||||
'建议保存Hi快VPN防丢二维码到相册\n永久保障您的互联网自由',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryColor,
|
||||
fontSize: 14.sp,
|
||||
height: 1.5,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.w),
|
||||
// QR Code
|
||||
LayoutBuilder(builder: (context, constraints) {
|
||||
// Use a reasonable size for the QR code
|
||||
return Container(
|
||||
width: 124.w,
|
||||
height: 124.w,
|
||||
child: QrImageView(
|
||||
data:
|
||||
'https://github.com/HiFastVPN/HiFastVPN', // Replace with real URL
|
||||
version: QrVersions.auto,
|
||||
backgroundColor: Colors.transparent,
|
||||
eyeStyle: QrEyeStyle(
|
||||
eyeShape: QrEyeShape.square,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
dataModuleStyle: QrDataModuleStyle(
|
||||
dataModuleShape: QrDataModuleShape.square,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
embeddedImage: const AssetImage(
|
||||
'assets/images/lost-poster-logo-white.png'),
|
||||
embeddedImageStyle: QrEmbeddedImageStyle(
|
||||
size: Size(36.w, 36.w),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
KrLocalImage(
|
||||
imageName: 'lost-image',
|
||||
imageType: ImageType.png,
|
||||
width: 298.w,
|
||||
height: 385.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 10.w),
|
||||
SizedBox(height: 30.w),
|
||||
|
||||
// Save Button
|
||||
GestureDetector(
|
||||
@@ -129,14 +76,6 @@ class HIAntiLostView extends GetView<HIAntiLostController> {
|
||||
),
|
||||
),
|
||||
|
||||
// 3. Invisible Share Card for Generation
|
||||
Positioned(
|
||||
left: 10000,
|
||||
child: RepaintBoundary(
|
||||
key: controller.repaintKey,
|
||||
child: const HIAntiLostShareCard(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user