Skip to content

Commit e5d5715

Browse files
aditya-cssSahil-Simform
authored andcommitted
doc: 📝 Add more class level documentation
1 parent 168dd06 commit e5d5715

22 files changed

+962
-560
lines changed

lib/src/models/action_button_icon.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,32 @@ import 'package:flutter/cupertino.dart';
2323
import 'package:flutter/material.dart';
2424

2525
class ActionButtonIcon {
26+
/// Creates an icon configuration for a tooltip action button with a
27+
/// standard [Icon].
28+
///
29+
/// The [icon] parameter is required and specifies the icon to display.
30+
/// The optional [padding] parameter defines spacing around the icon.
2631
const ActionButtonIcon({
2732
required Icon this.icon,
2833
this.padding,
2934
});
3035

36+
/// Creates an icon configuration for a tooltip action button with an
37+
/// [ImageIcon].
38+
///
39+
/// The [icon] parameter is required and specifies the image icon to display.
40+
/// The optional [padding] parameter defines spacing around the icon.
3141
const ActionButtonIcon.withImageIcon({
3242
required ImageIcon this.icon,
3343
this.padding,
3444
});
3545

46+
/// The icon widget to display in the button.
47+
///
48+
/// Can be either an [Icon] or [ImageIcon] depending on which constructor
49+
/// is used.
3650
final Widget icon;
51+
52+
/// Optional padding to apply around the icon.
3753
final EdgeInsets? padding;
3854
}

lib/src/models/linked_showcase_data.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
*/
2222
import 'package:flutter/widgets.dart';
2323

24-
/// This model is used to move linked showcase overlay data to parent
25-
/// showcase to crop linked showcase rect
24+
@immutable
2625
class LinkedShowcaseDataModel {
26+
/// This model is used to move linked showcase overlay data to parent
27+
/// showcase to crop linked showcase rect.
2728
const LinkedShowcaseDataModel({
2829
required this.rect,
2930
required this.radius,

lib/src/models/showcase_scope.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ import '../showcase/showcase_controller.dart';
2525
import '../showcase/showcase_view.dart';
2626

2727
class ShowcaseScope {
28+
/// A container class that manages showcase views within a specific named scope.
29+
///
30+
/// This class is responsible for:
31+
/// - Maintain a reference to a named scope and its associated [ShowcaseView].
32+
/// - Store and organize [ShowcaseController] instances by their GlobalKeys.
33+
/// - Enable multiple independent showcase systems to coexist in different
34+
/// parts of the app.
35+
/// - Facilitate proper routing of showcase events to the correct controllers.
36+
///
37+
/// This class is primarily used by [ShowcaseService] to manage showcase
38+
/// views and their controllers within different scopes, allowing for
39+
/// isolated showcase experiences that can be independently controlled and
40+
/// navigated.
2841
ShowcaseScope({
2942
required this.name,
3043
required this.showcaseView,

lib/src/models/tooltip_action_button.dart

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -24,75 +24,32 @@ import 'package:flutter/material.dart';
2424
import '../../showcaseview.dart';
2525

2626
class TooltipActionButton {
27-
/// To Provide Background color to the action
28-
final Color? backgroundColor;
29-
30-
/// To Provide borderRadius to the action
31-
///
32-
/// Defaults to const BorderRadius.all(Radius.circular(50)),
33-
final BorderRadius? borderRadius;
34-
35-
/// To Provide textStyle to the action text
36-
final TextStyle? textStyle;
37-
38-
/// To Provide padding to the action widget
39-
///
40-
/// Defaults to const EdgeInsets.symmetric(horizontal: 15,vertical: 4,)
41-
final EdgeInsets? padding;
42-
43-
/// To Provide a custom widget for the action in [TooltipActionButton.custom]
44-
final Widget? button;
45-
46-
/// To Provide a leading icon for the action
47-
final ActionButtonIcon? leadIcon;
48-
49-
/// To Provide a tail icon for the action
50-
final ActionButtonIcon? tailIcon;
51-
52-
/// To Provide a action type
53-
final TooltipDefaultActionType? type;
54-
55-
/// To Provide a text for action
56-
///
57-
/// If type is provided then it will take type name
58-
final String? name;
59-
60-
/// To Provide a onTap for action
61-
///
62-
/// If type is provided then it will take type's OnTap
63-
final VoidCallback? onTap;
64-
65-
/// To Provide a border for action
66-
final Border? border;
67-
68-
/// Hides action widgets for the showcase. Add key of particular showcase
69-
/// in this list.
70-
/// This only works for the global action widgets
71-
/// Defaults to []
72-
final List<GlobalKey> hideActionWidgetForShowcase;
73-
74-
/// A configuration for a tooltip action button or Provide a custom tooltip action.
27+
/// A configuration for a tooltip action button or Provide a custom tooltip
28+
/// action.
7529
///
7630
/// This class allows you to define predefined actions like "Next,"
7731
/// "Previous," and "Close," or specify a custom action widget.
7832
///
7933
/// **Required arguments:**
8034
///
81-
/// - `type`: The type of the action button (e.g., `TooltipDefaultActionType.next`).
35+
/// - `type`: The type of the action button (e.g.,
36+
/// `TooltipDefaultActionType.next`).
8237
///
8338
/// **Optional arguments:**
8439
///
8540
/// - `backgroundColor`: The background color of the button
8641
/// - `textStyle`: The text style for the button label.
87-
/// - `borderRadius`: The border radius of the button. Defaults to a rounded shape.
42+
/// - `borderRadius`: The border radius of the button. Defaults to a
43+
/// rounded shape.
8844
/// - `padding`: The padding around the button content.
8945
/// - `leadIcon`: An optional leading icon for the button.
9046
/// - `tailIcon`: An optional trailing icon for the button.
9147
/// - `name`: The text for the button label (ignored if `type` is provided).
9248
/// - `onTap`: A callback function triggered when the button is tapped.
9349
/// - `border`: A border to draw around the button.
94-
/// - `hideActionWidgetForShowcase`: A list of `GlobalKey`s of showcases where this
95-
/// action widget should be hidden. This only works for global action widgets.
50+
/// - `hideActionWidgetForShowcase`: A list of `GlobalKey`s of showcases
51+
/// where this action widget should be hidden. This only works for global
52+
/// action widgets.
9653
const TooltipActionButton({
9754
required this.type,
9855
this.backgroundColor,
@@ -125,4 +82,51 @@ class TooltipActionButton {
12582
name = null,
12683
onTap = null,
12784
border = null;
85+
86+
/// To Provide Background color to the action
87+
final Color? backgroundColor;
88+
89+
/// To Provide borderRadius to the action
90+
///
91+
/// Defaults to const BorderRadius.all(Radius.circular(50)),
92+
final BorderRadius? borderRadius;
93+
94+
/// To Provide textStyle to the action text
95+
final TextStyle? textStyle;
96+
97+
/// To Provide padding to the action widget
98+
///
99+
/// Defaults to const EdgeInsets.symmetric(horizontal: 15,vertical: 4,)
100+
final EdgeInsets? padding;
101+
102+
/// To Provide a custom widget for the action in [TooltipActionButton.custom]
103+
final Widget? button;
104+
105+
/// To Provide a leading icon for the action
106+
final ActionButtonIcon? leadIcon;
107+
108+
/// To Provide a tail icon for the action
109+
final ActionButtonIcon? tailIcon;
110+
111+
/// To Provide a action type
112+
final TooltipDefaultActionType? type;
113+
114+
/// To Provide a text for action
115+
///
116+
/// If type is provided then it will take type name
117+
final String? name;
118+
119+
/// To Provide a onTap for action
120+
///
121+
/// If type is provided then it will take type's OnTap
122+
final VoidCallback? onTap;
123+
124+
/// To Provide a border for action
125+
final Border? border;
126+
127+
/// Hides action widgets for the showcase. Add key of particular showcase
128+
/// in this list.
129+
/// This only works for the global action widgets
130+
/// Defaults to []
131+
final List<GlobalKey> hideActionWidgetForShowcase;
128132
}

lib/src/models/tooltip_action_config.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ class TooltipActionConfig {
6363

6464
/// Defines running direction alignment for the Action widgets.
6565
///
66-
/// Default to [crossAxisAlignment.start]
66+
/// Default to [CrossAxisAlignment.start]
6767
final CrossAxisAlignment crossAxisAlignment;
6868

6969
/// If aligning items according to their baseline, which baseline to use.
7070
///
71-
/// This must be set if using baseline alignment. There is no default because there is no
72-
/// way for the framework to know the correct baseline _a priori_.
71+
/// This must be set if using baseline alignment. There is no default
72+
/// because there is no way for the framework to know the correct baseline
73+
/// _a priori_.
7374
final TextBaseline? textBaseline;
7475
}

0 commit comments

Comments
 (0)