-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
717 additions
and
713 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CustomListTile extends StatelessWidget { | ||
const CustomListTile({ | ||
super.key, | ||
this.leading, | ||
this.title, | ||
this.subtitle, | ||
this.trailing, | ||
this.onTap, | ||
this.onLongPress, | ||
this.contentPadding, | ||
this.backgroundColor, | ||
}); | ||
|
||
final Widget? leading; | ||
final Widget? title; | ||
final Widget? subtitle; | ||
final Widget? trailing; | ||
final VoidCallback? onTap; | ||
final VoidCallback? onLongPress; | ||
final EdgeInsetsGeometry? contentPadding; | ||
final Color? backgroundColor; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return GestureDetector( | ||
onTap: onTap, | ||
onLongPress: onLongPress, | ||
behavior: HitTestBehavior.opaque, | ||
child: Container( | ||
width: double.infinity, | ||
padding: contentPadding ?? const EdgeInsets.all(12.0), | ||
decoration: BoxDecoration( | ||
color: backgroundColor ?? Theme.of(context).dialogBackgroundColor, | ||
borderRadius: BorderRadius.circular(8.0), | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
if (leading != null) leading!, | ||
if (leading != null) const SizedBox(width: 16.0), | ||
Expanded( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
if (title != null) title!, | ||
if (subtitle != null) subtitle!, | ||
], | ||
), | ||
), | ||
if (trailing != null) trailing!, | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.