2023-07-29 18:47:21 +08:00

156 lines
5.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
import '../../../tools/commonItem.dart';
import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart';
class ValueAddedServicesNoteAndEmailDetailPage extends StatefulWidget {
const ValueAddedServicesNoteAndEmailDetailPage({Key? key}) : super(key: key);
@override
State<ValueAddedServicesNoteAndEmailDetailPage> createState() =>
_ValueAddedServicesNoteAndEmailDetailPageState();
}
class _ValueAddedServicesNoteAndEmailDetailPageState
extends State<ValueAddedServicesNoteAndEmailDetailPage> {
@override
Widget build(BuildContext context) {
var type = ModalRoute.of(context)?.settings.arguments as int;
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: type == 1
? TranslationLoader.lanKeys!.note!.tr
: TranslationLoader.lanKeys!.mail!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Column(
children: [
Container(
width: 1.sw,
// color: Colors.grey.shade300,
padding: EdgeInsets.only(
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
child: Text(
type == 1
? TranslationLoader.lanKeys!.smsBuyTip!.tr
: TranslationLoader.lanKeys!.emailBuyTip!.tr,
style: TextStyle(
color: AppColors.darkGrayTextColor, fontSize: 18.sp),
)),
middleWidget(type),
],
),
);
}
Widget middleWidget(int type) {
return Container(
width: 1.sw,
// height: 100,
// color: Colors.grey.shade300,
margin: EdgeInsets.all(10.h),
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
"images/mine/icon_mine_valueAddedServices_noteTop.png"),
fit: BoxFit.cover)),
child: Column(children: [
// SizedBox(height:10),
Container(
margin:
const EdgeInsets.only(top: 15, bottom: 15, left: 30, right: 30),
child: Row(
children: [
Expanded(
child: Text(
"${TranslationLoader.lanKeys!.currentRemainingQuantity!.tr}:0",
style: TextStyle(fontSize: 24.sp),
)),
GestureDetector(
onTap: () {
Navigator.pushNamed(
context, Routers.valueAddedServicesBuyPage,
arguments: type);
},
child: Container(
width: 50,
height: 25,
decoration: BoxDecoration(
color: AppColors.mainColor,
borderRadius: BorderRadius.circular(25)),
child: Center(
child: Text(TranslationLoader.lanKeys!.buy!.tr,
style: TextStyle(
color: Colors.white, fontSize: 24.sp)))),
),
],
),
),
// SizedBox(height:20.h),
Container(
margin: const EdgeInsets.only(top: 10, bottom: 10),
// color: Colors.red,
// height: 100.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
if (type == 1) {
Navigator.pushNamed(context,
Routers.valueAddedServicesListSMSTemplatePage);
} else {
Navigator.pushNamed(context,
Routers.valueAddedServicesListEmailTemplatePage);
}
},
child: Row(
children: [
SizedBox(
width: 30.w,
),
Image.asset(
"images/mine/icon_mine_valueAddedServices_buyIcon.png",
width: 36.w,
height: 36.w,
),
Text(
(type == 1)
? TranslationLoader.lanKeys!.customSMSTemplate!.tr
: TranslationLoader.lanKeys!.customMailTemplate!.tr,
style: TextStyle(fontSize: 24.sp),
),
],
),
),
GestureDetector(
onTap: () {
Navigator.pushNamed(context,
Routers.valueAddedServicesBuyAndUseRecordManagePage);
},
child: Container(
width: 90,
// height: 70.h,
margin: const EdgeInsets.only(left: 10, right: 30),
padding: const EdgeInsets.only(
top: 5, bottom: 5, left: 5, right: 5),
// color: Colors.red,
child: Center(
child: Text(TranslationLoader.lanKeys!.record!.tr,
style: TextStyle(
color: Colors.black, fontSize: 24.sp)))),
),
],
),
),
]));
}
}