108 lines
3.3 KiB
Dart
108 lines
3.3 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:skywood/global/const/common_color.dart';
|
|
import 'package:skywood/global/request/api_const.dart';
|
|
import 'package:skywood/main/lib_file.dart';
|
|
import 'package:skywood/pages/mine/page/sky_web_page.dart';
|
|
import 'package:skywood/utils/tools/sky_device_info.dart';
|
|
import 'package:skywood/utils/tools/widgets/sky_app_bar.dart';
|
|
import 'package:skywood/utils/tools/widgets/sky_common_widget.dart';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
class AboutUsPage extends StatelessWidget {
|
|
|
|
const AboutUsPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: SkyAppBar(
|
|
title: 'About',
|
|
),
|
|
body: SizedBox(
|
|
width: double.infinity,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
const SizedBox(height: 50),
|
|
SizedBox(
|
|
width: 80, height: 80,
|
|
child: HelpImg.asset(ConstImg.appLogo),
|
|
),
|
|
const SizedBox(height: 10),
|
|
SkyText(text: ApiConst.appName,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.black,
|
|
),
|
|
const SizedBox(height: 5),
|
|
SkyText(text: 'V ${SkyDeviceInfo.instance.appVersion}',
|
|
fontSize: 12,
|
|
color: Colors.grey,
|
|
),
|
|
const SizedBox(height: 20),
|
|
_buildRowItem('Privacy Policy', () {
|
|
HelpNav.to(SkyWebPage(params: WebLinkParams(
|
|
title: 'Privacy Policy',
|
|
urlString: ApiConst.webPrivacy,
|
|
)));
|
|
}),
|
|
|
|
_buildRowItem('User Agreement', () {
|
|
HelpNav.to(SkyWebPage(params: WebLinkParams(
|
|
title: 'User Agreement',
|
|
urlString: ApiConst.webAgreement,
|
|
)));
|
|
}),
|
|
|
|
_buildRowItem('Visit Website', () async {
|
|
final encodedUrl = Uri.encodeFull(ApiConst.webIndex);
|
|
try {
|
|
final bool launched = await launchUrl(
|
|
Uri.parse(encodedUrl),
|
|
mode: LaunchMode.externalApplication,
|
|
);
|
|
if (!launched) {
|
|
print('无法打开链接: $encodedUrl');
|
|
}
|
|
} catch (e) {
|
|
print('打开链接异常: $e');
|
|
}
|
|
}),
|
|
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
_buildRowItem(String title, Function() onTap) {
|
|
return Container(
|
|
height: 46,
|
|
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 5),
|
|
margin: const EdgeInsets.only(bottom: 10),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
SkyText(text: title, fontSize: 14, color: Colors.black),
|
|
Icon(Icons.arrow_forward, color: CommonColor.black, size: 18,),
|
|
],
|
|
),
|
|
).addInkWell(onTap: onTap);
|
|
}
|
|
|
|
Future<void> openUrl(String url) async {
|
|
final encodedUrl = Uri.encodeFull(url);
|
|
try {
|
|
final bool launched = await launchUrl(
|
|
Uri.parse(encodedUrl),
|
|
mode: LaunchMode.externalApplication,
|
|
);
|
|
if (!launched) {
|
|
print('无法打开链接: $encodedUrl');
|
|
}
|
|
} catch (e) {
|
|
print('打开链接异常: $e');
|
|
}
|
|
}
|
|
} |