SnsContentTile class
A widget for displaying social media-style content with profile layout.
This widget creates a Twitter/X-style post layout with a leading avatar, title (username), subtitle (handle/timestamp), main content, and optional bottom actions. Perfect for social media feeds, comment sections, and user-generated content displays.
Features:
- Leading widget area (typically for profile avatars)
- Title and subtitle in header row (username and handle/timestamp)
- Main content area with customizable padding
- Optional bottom action area (like, share, comment buttons)
- Customizable spacing between elements
- Theme-based text and icon styling
- Tap interaction support
Example:
SnsContentTile(
leading: CircleAvatar(child: Icon(Icons.person)),
title: Text("Username"),
subtitle: Text("@handle · 2h"),
content: Text("This is the post content..."),
bottom: Row(
children: [
IconButton(icon: Icon(Icons.favorite_border), onPressed: () {}),
IconButton(icon: Icon(Icons.chat_bubble_outline), onPressed: () {}),
],
),
)
SNSのコンテンツを表示するウィジェット。
このウィジェットはTwitter/Xスタイルの投稿レイアウトを作成し、リーディングアバター、 タイトル(ユーザー名)、サブタイトル(ハンドル/タイムスタンプ)、メインコンテンツ、 オプションのボトムアクションを含みます。ソーシャルメディアフィード、コメントセクション、 ユーザー生成コンテンツの表示に最適です。
特徴:
- リーディングウィジェットエリア(通常はプロフィールアバター用)
- ヘッダー行のタイトルとサブタイトル(ユーザー名とハンドル/タイムスタンプ)
- カスタマイズ可能なパディングを持つメインコンテンツエリア
- オプションのボトムアクションエリア(いいね、シェア、コメントボタン)
- 要素間のカスタマイズ可能なスペーシング
- テーマベースのテキストとアイコンのスタイリング
- タップインタラクションのサポート
例:
SnsContentTile(
leading: CircleAvatar(child: Icon(Icons.person)),
title: Text("ユーザー名"),
subtitle: Text("@handle · 2時間前"),
content: Text("投稿内容がここに入ります..."),
bottom: Row(
children: [
IconButton(icon: Icon(Icons.favorite_border), onPressed: () {}),
IconButton(icon: Icon(Icons.chat_bubble_outline), onPressed: () {}),
],
),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SnsContentTile
Constructors
- SnsContentTile({Key? key, VoidCallback? onTap, Color? backgroundColor, EdgeInsetsGeometry? margin, Widget? leading, double space = 8, Widget? title, Widget? content, Widget? subtitle, Color? iconColor, Color? textColor, EdgeInsetsGeometry contentPadding = const EdgeInsets.symmetric(vertical: 16), Widget? bottom, EdgeInsetsGeometry padding = const EdgeInsets.symmetric(vertical: 16)})
-
A widget for displaying social media-style content with profile layout.
const
Properties
- backgroundColor → Color?
-
The background color of the card.
final
- bottom → Widget?
-
The widget below this widget in the tree.
final
- content → Widget?
-
Content of the list item.
final
- contentPadding → EdgeInsetsGeometry
-
The padding around the ListTile content.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconColor → Color?
-
The color to use for icons and text in the list tile.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
The widget to display before the title.
final
- margin → EdgeInsetsGeometry?
-
The margin around the card.
final
- onTap → VoidCallback?
-
A callback that is called when the card is tapped.
final
- padding → EdgeInsetsGeometry
-
The padding around the widget.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- space → double
-
The space between the leading widget and the title.
final
- subtitle → Widget?
-
Widget to be displayed next to the title.
final
- textColor → Color?
-
The color to use for the text in the list tile.
final
- title → Widget?
-
Title of the list item.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited