You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.5 KiB

import 'package:flutter/material.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/home/content_details_page.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart';
class ContentPage extends StatefulWidget {
const ContentPage({Key? key}) : super(key: key);
@override
_ContentPageState createState() => _ContentPageState();
}
class _ContentPageState extends State<ContentPage> {
List<String> textList = ['欢迎你的来电', '祝您生活愉快', '感谢您的来电我们会尽快处理的'];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
'选择短信内容',
style: Theme.of(context).textTheme.headline6,
),
leading: const CloudBackButton(isSpecial: true),
backgroundColor: kForeGroundColor,
),
body: Column(children: [
Expanded(
child: _getList(),
),
_getBox2("自定义短信内容"),
32.hb
]),
);
}
_getList() {
return ListView.builder(
itemBuilder: (context, index) {
return _getBox(textList[index], index == 0);
},
itemCount: textList.length,
);
}
_getBox(String content, bool pd) {
return Container(
width: 686.w,
height: 122.w,
margin: EdgeInsets.only(top: 32.w, left: 32.w, right: 32.w),
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 30.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: pd ? Colors.blue : Colors.white,
),
child: Text(content,
style: TextStyle(
fontSize: BaseStyle.fontSize28,
color: pd ? const Color(0xFFF9F9F9) : BaseStyle.color333333)),
);
}
_getBox2(
String content,
) {
return GestureDetector(
onTap: () {
Get.to(() => const ContentDetailsPage());
},
child: Container(
width: 686.w,
height: 122.w,
margin: EdgeInsets.only(top: 32.w, left: 32.w, right: 32.w),
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 30.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: Colors.white,
),
child: Text(
content,
style: TextStyle(
fontSize: BaseStyle.fontSize28, color: const Color(0xFF000000)),
)),
);
}
}