用户资料

This commit is contained in:
2022-10-26 13:24:11 +08:00
parent 69f0a7a81e
commit afee57df73
12 changed files with 368 additions and 35 deletions

View File

@@ -0,0 +1,74 @@
import 'package:chat/configs/app_colors.dart';
import 'package:chat/configs/app_size.dart';
import 'package:flutter/material.dart';
class LinkActionItem extends StatelessWidget {
final IconData? prefix;
final String title;
final String? cover;
final Widget? trailing;
final bool? isLink;
final GestureTapCallback? onTap;
const LinkActionItem({
Key? key,
this.prefix,
this.cover,
required this.title,
this.isLink,
this.trailing,
this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: onTap,
child: Container(
color: AppColors.white,
padding: const EdgeInsets.symmetric(
vertical: 20,
horizontal: 16,
),
child: Row(
children: [
if (prefix != null)
Icon(
prefix,
color: AppColors.unactive,
size: 18,
),
const SizedBox(width: 8),
if (cover != null)
Image.asset(
'assets/user/$cover.png',
width: 24,
height: 24,
),
const SizedBox(width: 8),
Expanded(
child: Text(
title,
style: const TextStyle(
fontSize: 15,
),
),
),
if (trailing != null) trailing!,
if (isLink == true)
const Icon(
Icons.chevron_right,
color: AppColors.unactive,
),
],
),
),
),
const Divider(height: AppSize.dividerHeight),
],
);
}
}