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.
project_telephony/lib/ui/home/content_details_page.dart

115 lines
3.3 KiB

2 years ago
import 'package:flutter/material.dart';
import 'package:project_telephony/utils/headers.dart';
import '../../base/base_style.dart';
import '../widget/plone_back_button.dart';
import '../widget/plone_bottom.dart';
2 years ago
typedef TextCallback = Function(String textContent);
2 years ago
class ContentDetailsPage extends StatefulWidget {
2 years ago
final TextCallback ploneBack;
final String content;
const ContentDetailsPage(
{Key? key, required this.content, required this.ploneBack})
: super(key: key);
2 years ago
@override
_ContentDetailsPageState createState() => _ContentDetailsPageState();
}
2 years ago
String content = "";
2 years ago
class _ContentDetailsPageState extends State<ContentDetailsPage> {
2 years ago
late TextEditingController _controller;
@override
void initState() {
super.initState();
_controller = TextEditingController(text: widget.content);
}
2 years ago
@override
Widget build(BuildContext context) {
return Scaffold(
2 years ago
resizeToAvoidBottomInset: false,
2 years ago
appBar: AppBar(
2 years ago
elevation: 0,
title: Text(
'编辑短信内容',
style: TextStyle(
fontSize: BaseStyle.fontSize34,
color: BaseStyle.color333333,
fontWeight: FontWeight.bold),
),
titleSpacing: 162.w,
leading: const CloudBackButton(isSpecial: true),
backgroundColor: kForeGroundColor),
backgroundColor: Colors.white,
2 years ago
body: _getBox(),
);
}
2 years ago
_getBox() {
2 years ago
return Column(children: [
Container(
width: 622.w,
height: 960.w,
2 years ago
decoration: BoxDecoration(
color: const Color(0xFFF9F9F9),
borderRadius: BorderRadius.circular(16.w)),
margin: EdgeInsets.only(top: 32.w, bottom: 298.w),
child: Container(
// color: kForeGroundColor,
margin: EdgeInsets.symmetric(horizontal: 40.w, vertical: 50.w),
child: TextField(
maxLines: 100,
keyboardType: TextInputType.text,
onEditingComplete: () {
setState(() {});
// _refreshController.callRefresh();
},
onChanged: (text) {
content = text;
2 years ago
// print(content);
2 years ago
setState(() {});
},
style: TextStyle(
color: BaseStyle.color333333,
fontSize: BaseStyle.fontSize28,
),
controller: _controller,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
filled: true,
isDense: true,
fillColor: Colors.white,
hintText: widget.content != "" ? "" : "请输入短信内容",
hintStyle: TextStyle(
color: widget.content != ""
? const Color(0xFF333333)
: Colors.grey.shade500,
fontSize: 28.sp,
fontWeight: FontWeight.bold),
border: InputBorder.none,
),
),
),
2 years ago
2 years ago
// Text(widget.content,),
),
PloneBottom(
border: !content.isNotEmpty,
opacity: content.isNotEmpty ? 1 : 0.4,
onTap: () {
setState(() {});
widget.ploneBack(content);
Get.back();
// print(content);
},
text: "保存",
)
2 years ago
]);
}
}