Files
doyin/lib/app/modules/chat/contactModule/contactViews/homePage/chatInfo.dart
2025-07-07 18:45:44 +08:00

308 lines
8.4 KiB
Dart

// import 'package:caller/app/constants/constants.dart';
// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// import 'package:get/get.dart';
// class ChatInfoPage extends StatefulWidget {
// // final String id;
// // ChatInfoPage(this.id);
// @override
// _ChatInfoPageState createState() => _ChatInfoPageState();
// }
// class _ChatInfoPageState extends State<ChatInfoPage> {
// bool isRemind = false;
// bool isTop = false;
// bool isDoNotDisturb = true;
// Widget buildSwitch(item) {
// return new LabelRow(
// label: item['label'] as String,
// margin: item['label'] == '消息免打扰' ? EdgeInsets.only(top: 10.0) : null,
// isLine: item['label'] != '强提醒',
// isRight: false,
// rightW: new SizedBox(
// height: 25.0,
// child: new CupertinoSwitch(
// value: item['value'] as bool,
// onChanged: (v) {},
// ),
// ),
// onPressed: () {},
// );
// }
// List<Widget> body() {
// List switchItems = [
// {"label": '消息免打扰', 'value': isDoNotDisturb},
// {"label": '置顶聊天', 'value': isTop},
// {"label": '强提醒', 'value': isRemind},
// ];
// return [
// // new ChatMamBer(model: model),
// new LabelRow(
// label: '查找聊天记录',
// margin: EdgeInsets.only(top: 10.0),
// // onPressed: () => Get.to<void>(new SearchPage()),
// ),
// new Column(
// children: switchItems.map(buildSwitch).toList(),
// ),
// new LabelRow(
// label: '设置当前聊天背景',
// margin: EdgeInsets.only(top: 10.0),
// // onPressed: () => Get.to<void>(new ChatBackgroundPage()),
// ),
// new LabelRow(
// label: '清空聊天记录',
// margin: EdgeInsets.only(top: 10.0),
// // onPressed: () {
// // // confirmAlert(
// // // context,
// // // (isOK) {
// // // if (isOK) showToast('敬请期待');
// // },
// // tips: '确定删除群的聊天记录吗?',
// // okBtn: '清空',
// // );
// // },
// ),
// new LabelRow(
// label: '投诉',
// margin: EdgeInsets.only(top: 10.0),
// // onPressed: () =>
// // Get.to<void>(new WebViewPage(url: helpUrl, title: '投诉')),
// ),
// ];
// }
// @override
// void initState() {
// super.initState();
// getInfo();
// }
// Future<void> getInfo() async {
// // final List<V2TimUserFullInfo> infoList = await getUsersProfile([widget.id]);
// // if (infoList.isEmpty) {
// // // showToast('获取用户信息错误');
// // return;
// // }
// setState(() {
// // model = infoList[0];
// });
// }
// @override
// Widget build(BuildContext context) {
// return new Scaffold(
// backgroundColor: chatBg,
// appBar: new ComMomBar(title: '聊天信息'),
// body: new SingleChildScrollView(
// child: new Column(children: body()),
// ),
// );
// }
// }
// class LabelRow extends StatelessWidget {
// final String? label;
// final VoidCallback? onPressed;
// final double? labelWidth;
// final bool isRight;
// final bool isLine;
// final String? value;
// final String? rValue;
// final Widget? rightW;
// final EdgeInsetsGeometry? margin;
// final EdgeInsetsGeometry padding;
// final Widget? headW;
// final double lineWidth;
// LabelRow({
// this.label,
// this.onPressed,
// this.value,
// this.labelWidth,
// this.isRight = true,
// this.isLine = false,
// this.rightW,
// this.rValue,
// this.margin,
// this.padding = const EdgeInsets.only(top: 15.0, bottom: 15.0, right: 5.0),
// this.headW,
// this.lineWidth = mainLineWidth,
// });
// @override
// Widget build(BuildContext context) {
// return Container(
// margin: margin,
// child: TextButton(
// style: TextButton.styleFrom(
// backgroundColor: Colors.white,
// padding: EdgeInsets.all(0),
// ),
// onPressed: onPressed ?? () {},
// child: Container(
// padding: padding,
// margin: EdgeInsets.only(left: 20.0),
// decoration: BoxDecoration(
// border: isLine
// ? Border(bottom: BorderSide(color: lineColor, width: lineWidth))
// : null,
// ),
// child: Row(
// children: <Widget>[
// if (headW != null) headW!,
// SizedBox(
// width: labelWidth,
// child: Text(
// label ?? '',
// style: TextStyle(fontSize: 17.0),
// ),
// ),
// if (value != null)
// Text(
// value!,
// style: TextStyle(
// color: mainTextColor.withOpacity(0.7),
// ),
// ),
// Spacer(),
// if (rValue != null)
// Text(
// rValue!,
// style: TextStyle(
// color: mainTextColor.withOpacity(0.7),
// fontWeight: FontWeight.w400,
// ),
// ),
// if (rightW != null) rightW!,
// if (isRight)
// Icon(
// CupertinoIcons.right_chevron,
// color: mainTextColor.withOpacity(0.5),
// )
// else
// Container(width: 10.0),
// ],
// ),
// ),
// ),
// );
// }
// }
// class ComMomBar extends StatelessWidget implements PreferredSizeWidget {
// const ComMomBar({
// Key? key,
// this.title = '',
// this.showShadow = false,
// this.rightDMActions,
// this.backgroundColor = appBarColor,
// this.mainColor = Colors.black,
// this.titleW,
// this.bottom,
// this.leadingImg = '',
// this.leadingW,
// }) : super(key: key);
// final String title;
// final bool showShadow;
// final List<Widget>? rightDMActions;
// final Color backgroundColor;
// final Color mainColor;
// final Widget? titleW;
// final Widget? leadingW;
// final PreferredSizeWidget? bottom;
// final String leadingImg;
// @override
// Size get preferredSize => const Size.fromHeight(50.0);
// Widget? leading(BuildContext context) {
// final bool isShow = Navigator.canPop(context);
// if (isShow) {
// return InkWell(
// child: Container(
// width: 15,
// height: 28,
// child: leadingImg.isNotEmpty
// ? Image.asset(leadingImg)
// : Icon(CupertinoIcons.back, color: mainColor),
// ),
// onTap: () {
// if (Navigator.canPop(context)) {
// FocusScope.of(context).requestFocus(FocusNode());
// Navigator.pop(context);
// }
// },
// );
// } else {
// return null;
// }
// }
// @override
// Widget build(BuildContext context) {
// return showShadow
// ? Container(
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(color: Colors.grey, width: showShadow ? 0.5 : 0.0),
// ),
// ),
// child: AppBar(
// title: titleW ?? Text(
// title,
// style: TextStyle(
// color: mainColor,
// fontSize: 17.0,
// fontWeight: FontWeight.w600,
// ),
// ),
// backgroundColor: mainColor,
// elevation: 0.0,
// // brightness: Brightness.light,
// leading: leadingW ?? leading(context),
// centerTitle: true,
// actions: rightDMActions ?? [Center()],
// bottom: bottom,
// ),
// )
// : AppBar(
// title: titleW ?? Text(
// title,
// style: TextStyle(
// color: mainColor,
// fontSize: 17.0,
// fontWeight: FontWeight.w600,
// ),
// ),
// backgroundColor: backgroundColor,
// elevation: 0.0,
// // brightness: Brightness.light,
// leading: leadingW ?? leading(context),
// centerTitle: false,
// bottom: bottom,
// actions: rightDMActions ?? [Center()],
// );
// }
// }