用户资料
This commit is contained in:
74
lib/views/user/widgets/link_action_item.dart
Normal file
74
lib/views/user/widgets/link_action_item.dart
Normal 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),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user