Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ class Showcase extends StatefulWidget {
final TextAlign titleAlignment;

/// Represents summary description of target widget
final Widget? additionalDescriptionWidget;

/// The `additionalDescriptionWidget` allows you to place any desired widget
/// below the description text. This can be used to provide additional
/// context, status indicators, or any other relevant information
/// directly beneath the description.

final String? description;

/// ShapeBorder of the highlighted box when target widget will be showcased.
Expand Down Expand Up @@ -256,6 +263,7 @@ class Showcase extends StatefulWidget {
required this.key,
required this.description,
required this.child,
this.additionalDescriptionWidget,
this.title,
this.titleAlignment = TextAlign.start,
this.descriptionAlignment = TextAlign.start,
Expand Down Expand Up @@ -321,6 +329,7 @@ class Showcase extends StatefulWidget {
Radius.circular(8),
),
),
this.additionalDescriptionWidget,
this.overlayColor = Colors.black45,
this.targetBorderRadius,
this.overlayOpacity = 0.75,
Expand Down Expand Up @@ -599,6 +608,7 @@ class _ShowcaseState extends State<Showcase> {
targetPadding: widget.targetPadding,
),
ToolTipWidget(
additionalDescriptionWidget: widget.additionalDescriptionWidget,
position: position,
offset: offset,
screenSize: screenSize,
Expand Down
37 changes: 23 additions & 14 deletions lib/src/tooltip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ToolTipWidget extends StatefulWidget {
final String? title;
final TextAlign? titleAlignment;
final String? description;
final Widget? additionalDescriptionWidget;
final TextAlign? descriptionAlignment;
final TextStyle? titleTextStyle;
final TextStyle? descTextStyle;
Expand Down Expand Up @@ -72,6 +73,7 @@ class ToolTipWidget extends StatefulWidget {
required this.title,
required this.titleAlignment,
required this.description,
required this.additionalDescriptionWidget,
required this.titleTextStyle,
required this.descTextStyle,
required this.container,
Expand Down Expand Up @@ -461,20 +463,27 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
Padding(
padding: widget.descriptionPadding ??
EdgeInsets.zero,
child: Text(
widget.description!,
textAlign: widget.descriptionAlignment,
textDirection:
widget.descriptionTextDirection,
style: widget.descTextStyle ??
Theme.of(context)
.textTheme
.titleSmall!
.merge(
TextStyle(
color: widget.textColor,
),
),
child: Column(
children: [
Text(
widget.description!,
textAlign:
widget.descriptionAlignment,
textDirection:
widget.descriptionTextDirection,
style: widget.descTextStyle ??
Theme.of(context)
.textTheme
.titleSmall!
.merge(
TextStyle(
color: widget.textColor,
),
),
),
widget.additionalDescriptionWidget ??
const SizedBox(),
],
),
),
],
Expand Down