54 lines
1.3 KiB
Dart
54 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ProfileItem extends StatelessWidget {
|
|
final String title;
|
|
final String? subtitle;
|
|
final IconData? leading;
|
|
final VoidCallback onTap;
|
|
|
|
const ProfileItem({
|
|
super.key,
|
|
required this.title,
|
|
this.subtitle,
|
|
this.leading,
|
|
required this.onTap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
margin: EdgeInsets.zero,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
),
|
|
color: Colors.grey.shade100,
|
|
child: ListTile(
|
|
title: Text(
|
|
title,
|
|
style: const TextStyle(color: Colors.black),
|
|
),
|
|
subtitle: subtitle == null || subtitle!.isEmpty
|
|
? null
|
|
: Text(
|
|
subtitle ?? '',
|
|
style: const TextStyle(color: Colors.black),
|
|
),
|
|
leading: leading == null
|
|
? null
|
|
: Icon(
|
|
leading,
|
|
color: Colors.black,
|
|
),
|
|
trailing: const Icon(
|
|
Icons.keyboard_arrow_right,
|
|
color: Colors.black,
|
|
),
|
|
onTap: onTap,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|