-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmtooltip_controller.dart
More file actions
37 lines (33 loc) · 1.18 KB
/
mtooltip_controller.dart
File metadata and controls
37 lines (33 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import '../controller/mtooltip_controller_impl.dart';
import '../core/mtooltip.dart';
/// Controller interface for driving an [MTooltip] instance.
///
/// Implementations of this interface can be attached to an [MTooltipState]
/// and provide a simple programmatic API to show or remove the tooltip.
///
/// Usage:
/// ```dart
/// final controller = MTooltipController(); // returns IMTooltipController
/// // Provide `controller` to an MTooltip instance.
/// controller.show();
/// controller.remove();
/// ```
abstract class MTooltipController {
/// Show the attached tooltip.
///
/// If no [MTooltipState] is attached this call is a no-op.
void show();
/// Remove / dismiss the attached tooltip immediately.
///
/// If no [MTooltipState] is attached this call is a no-op.
void remove();
/// Attach a live [MTooltipState] to this controller.
///
/// The controller will forward subsequent [show] and [remove] calls to the
/// provided state instance.
void attach(MTooltipState widget);
/// Factory constructor that returns the default implementation.
///
/// Currently returns an instance of [IMTooltipController].
factory MTooltipController() => IMTooltipController();
}