基础页面
This commit is contained in:
76
lib/views/home/widgets/action_item.dart
Normal file
76
lib/views/home/widgets/action_item.dart
Normal file
@@ -0,0 +1,76 @@
|
||||
import 'package:chat/configs/app_colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ActionItem extends StatelessWidget {
|
||||
final String title;
|
||||
final String? extend;
|
||||
final Widget? rightWidget;
|
||||
final String? bottom;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
const ActionItem(
|
||||
this.title, {
|
||||
this.extend,
|
||||
this.rightWidget,
|
||||
this.bottom,
|
||||
this.onTap,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
onTap?.call();
|
||||
},
|
||||
child: Container(
|
||||
color: AppColors.white,
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
if (extend != null)
|
||||
Text(
|
||||
extend!,
|
||||
style: const TextStyle(
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
),
|
||||
rightWidget ??
|
||||
const Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 16,
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
],
|
||||
),
|
||||
if (bottom != null && bottom!.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
bottom!,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
color: AppColors.unactive,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user