feat: 增加防丢失页面

This commit is contained in:
2026-01-12 06:49:03 -08:00
parent 0474f3c9d9
commit 26f6c10557
16 changed files with 390 additions and 0 deletions
@@ -0,0 +1,89 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:kaer_with_panels/app/widgets/kr_app_text_style.dart';
class HIAntiLostShareCard extends StatelessWidget {
const HIAntiLostShareCard({super.key});
@override
Widget build(BuildContext context) {
// Fixed width for the generated image, independent of screen size
final double cardWidth = 375.0;
final double cardHeight = 600.0; // Approx height
return Container(
width: cardWidth,
// minimal height or let it expand
padding: EdgeInsets.all(20),
color: Colors.black, // Dark background
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 40),
// Title
Text(
'保存二维码,防止失联',
style: TextStyle(
color: const Color(0xFFCCFF00),
fontSize: 24,
fontWeight: FontWeight.bold,
fontFamily: 'AlibabaPuHuiTi-Medium',
),
),
SizedBox(height: 20),
// Description
Text(
'建议保存Hi快VPN防丢二维码到相册\n永久保障您的互联网自由',
textAlign: TextAlign.center,
style: TextStyle(
color: const Color(0xFFCCFF00),
fontSize: 14,
height: 1.5,
fontFamily: 'AlibabaPuHuiTi-Regular',
),
),
SizedBox(height: 40),
// QR Code Card
Container(
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.black,
border: Border.all(color: const Color(0xFFCCFF00), width: 3),
borderRadius: BorderRadius.circular(20),
),
child: QrImageView(
data: 'https://github.com/hi-vpn/hi-client', // Replace with actual URL
version: QrVersions.auto,
size: 200,
backgroundColor: Colors.transparent,
eyeStyle: const QrEyeStyle(
eyeShape: QrEyeShape.square,
color: Color(0xFFCCFF00),
),
dataModuleStyle: const QrDataModuleStyle(
dataModuleShape: QrDataModuleShape.square,
color: Color(0xFFCCFF00),
),
embeddedImage: const AssetImage('assets/images/kr-logo.png'),
embeddedImageStyle: const QrEmbeddedImageStyle(
size: Size(50, 50),
),
),
),
SizedBox(height: 40),
// Footer branding
Text(
'HiVPN',
style: TextStyle(
color: Colors.white.withOpacity(0.5),
fontSize: 12,
letterSpacing: 2,
),
),
SizedBox(height: 20),
],
),
);
}
}