apptomate_custom_list_tile 0.0.3
apptomate_custom_list_tile: ^0.0.3 copied to clipboard
An enhanced ListTile widget with extensive customization options for building beautiful list items with interactive elements.
example/lib/main.dart
import 'package:apptomate_custom_list_tile/apptomate_custom_list_tile.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Enhanced ListTile Examples')),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
// Basic Example
CustomListTile(
title: 'Basic Tile',
subtitle: 'With default styling',
leading: const CircleAvatar(child: Icon(Icons.person)),
onTap: () => print('Basic tile tapped'),
),
const SizedBox(height: 12),
// Advanced Example
CustomListTile(
title: 'Premium Tile',
subtitle: 'With all features',
subtitleWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Custom subtitle widget'),
const SizedBox(height: 4),
Row(
children: [
Icon(Icons.star, color: Colors.amber, size: 16),
const SizedBox(width: 4),
Text('5.0', style: TextStyle(color: Colors.amber)),
],
),
],
),
leading: Container(
width: 48,
height: 48,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
colors: [Colors.blue, Colors.lightBlueAccent],
),
),
child: const Icon(Icons.person, color: Colors.white),
),
trailing: PopupMenuButton(
icon: const Icon(Icons.more_vert),
itemBuilder: (context) => [
const PopupMenuItem(child: Text('Edit')),
const PopupMenuItem(child: Text('Delete')),
],
),
backgroundColor: Colors.white,
borderRadius: 12,
elevation: 8,
shadowColor: Colors.blue.withOpacity(0.3),
titleStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.blue,
),
subtitleStyle: const TextStyle(
fontSize: 14,
color: Colors.blueGrey,
),
onTap: () => print('Premium tile tapped'),
onLongPress: () => print('Premium tile long pressed'),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Colors.white, Colors.lightBlue.shade50],
),
border: Border.all(color: Colors.blue.shade100),
customShadows: [
BoxShadow(
color: Colors.blue.withOpacity(0.2),
blurRadius: 10,
spreadRadius: 2,
offset: const Offset(0, 4),
),
],
),
const SizedBox(height: 12),
// Disabled Example
CustomListTile(
title: 'Disabled Tile',
subtitle: 'Non-interactive example',
leading: const Icon(Icons.block, color: Colors.grey),
enabled: false,
backgroundColor: Colors.grey.shade100,
),
],
),
);
}
}