app-starlock/lib/mine/supportStaff/supportStaff_page.dart
2024-05-18 09:37:50 +08:00

136 lines
4.2 KiB
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../app_settings/app_colors.dart';
import '../../tools/commonItem.dart';
import '../../tools/titleAppBar.dart';
import '../../translations/trans_lib.dart';
class SupportStaffPage extends StatefulWidget {
const SupportStaffPage({Key? key}) : super(key: key);
@override
State<SupportStaffPage> createState() => _SupportStaffPageState();
}
class _SupportStaffPageState extends State<SupportStaffPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFFFFFFF),
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.supportStaff!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Column(
children: [
supportStaffItem(
TranslationLoader.lanKeys!.email!.tr,
"786612630@qq.com",
true,
true,
'images/mine/icon_mine_supportStaff_openEmail.png', () async {
String url =
'mailto:smith@example.org?subject=News&body=New%20plugin';
_pushUrl(url);
}),
supportStaffItem(
TranslationLoader.lanKeys!.businessCooperation!.tr,
"www.starLock.com",
true,
true,
'images/mine/icon_mine_supportStaff_openEmail.png', () async {
const url = 'tel:15080825640';
_pushUrl(url);
}),
supportStaffItem(
TranslationLoader.lanKeys!.officialWebsite!.tr,
"www.starLock.com",
true,
true,
'images/mine/icon_mine_supportStaff_jump.png', () async {
const url = 'https://blog.csdn.net/shulianghan';
_pushUrl(url);
}),
supportStaffItem(TranslationLoader.lanKeys!.computerWebVersion!.tr,
"www.starLock.com", false, true, '', () {}),
supportStaffItem(TranslationLoader.lanKeys!.hotelSystem!.tr,
"www.starLock.com", false, true, '', () {}),
supportStaffItem(
TranslationLoader.lanKeys!.manualWebVersion!.tr,
"www.starLock.com",
true,
true,
'images/mine/icon_mine_supportStaff_jump.png',
() {}),
],
),
);
}
_pushUrl(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
Widget supportStaffItem(
String? leftTitel,
String? rightTitle,
bool? isHaveRightImg,
bool? isHaveLine,
String? rightImg,
Function()? action,
) {
return GestureDetector(
onTap: action,
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 80.h,
color: Colors.white,
padding: EdgeInsets.only(
left: 20.w, right: 10.w), // , top: 20.w, bottom: 20.w
child: Row(
children: [
SizedBox(width: 20.w),
Expanded(
child: Text(leftTitel!, style: TextStyle(fontSize: 24.sp))),
SizedBox(width: 20.w),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(rightTitle!,
textAlign: TextAlign.end,
style: TextStyle(fontSize: 22.sp))
],
),
SizedBox(width: 5.w),
isHaveRightImg!
? Image.asset(
rightImg!,
width: 36.w,
height: 36.w,
)
: SizedBox(width: 10.w),
// SizedBox(width:10.w),
],
),
),
isHaveLine!
? Container(
height: 0.5.h,
color: AppColors.greyLineColor,
)
: Container()
],
),
);
}
}